[fpc-devel]Bad heap manager?
Peter Vreman
peter at freepascal.org
Fri Mar 1 15:54:01 CET 2002
>
> >Today I tried to use FPC 1.1 (Win32 target) to compile my program which
> >creates very many dynamic objects and also I compiled the same program with
>
>If the problem is fragmentation, the solution should be a memory pool
>with fixed size blocks.
>
>If when you say "objects" you mean classes derived from TObject, you
>could try overriding NewInstance to use such a memory pool, instead of
>taking the memory from the global heap.
The problem was that sizeof(<TClass>) returned a wrong value. Here at my PC
it returned 1000000 so allocating 4 objects would already allocate 4Mb
instead of only 16 bytes.
So there is no problem with the heap manager.
Peter
More information about the fpc-devel
mailing list