[fpc-devel] Boehm garbage collector for freepascal

Florian Klaempfl florian at freepascal.org
Fri Nov 19 09:55:42 CET 2010

Am 18.11.2010 15:27, schrieb Thaddy:
>  On 18-11-2010 13:21, Ċ½ilvinas Ledas wrote:
>>> But it might be an advantage for some projects as the discussions
>>> over the years implied. 
>> What about using GC for fpc itself? If it is usable for fpc, then the
>> problem of fpc leaking memory when compilation fails with errors can
>> be solved using GC. As a result fpc can be integrated to some IDEs
>> without a fear or memleaks.
>> Just a thought.
>> Regards
>> Zilvinas Ledas
> It is not a very good idea to use a GC as a means to catch mistakes made
> by a programmer.
> These kind of mistakes can still cause memory resource related problems
> or violations.
> That's not why I (re)wrote my GC interface unit (again) anyway.
> But, there is no reason why it shouldn't work.

It works, but there is a small problem: the compiler itself is a
nightmare for any heap manager and it shows *THE* disadvantages of GC:
it is sloooooooooooooooooow.
Compiling the system unit with the default heap manager:
0.4 sec
with the BoehmGC port
98.9 sec (creates a ppu, but crashes on exit)

And no, FPC does not a lot huge memory allocations, just a lot of small
ones and I mean really a lot :)

More information about the fpc-devel mailing list