This question is a follow up of this question.
How can I achieve that my application and my runtime package use the same memory manager? I thought that this was the case by default but since I get strange access violations and invalid pointer exceptions, I inserted calls to GetMemoryManagerState
just before entry to the runtime package and in the runtime package and the returned state seems to indicate that the package and the application use separate memory managers.
Before calling a method in the runtime package, there are 61 allocated medium blocks and after the call (at the beginning of the called method inside the package) there are 0 allocated medium blocks.
Do you happen to have an explanation for that? What do I have to do to make package and application share the memory manager? Any more complicated issues when using FastMM?
EDIT BTW, is there a better way to check if the same memory manager is used than comparing memory manager state? TMemoryManager
turns out to be a record, so I can't compare adresses.