8-Mar-00 13:44 you wrote:
Hello!
Does GNU Pascal have a runtime garbage collector?
No. To All: perhaps something can be done here ?
Yes. It is straightforward to use GCC's "obstacks" from GPC. Someone would just have to write a portable Unit to use them. It could even hook into GPC's `New' routine.
Huh. May be I misundestood something but how obstacks will help create something akin to attached C++ example ?
Someone?
So far I can not understood how to have both NonGC-capable new and GC-capable new in one program in the same time (switching is not an option: think about threads!).
P.S. Sample will work this way: -- cut -- [khim@localhost khim]$ ./test OldNormalNonGcClass created TestClass created OldNormalNonGcClass destroyed TestClass destroyed [khim@localhost khim]$ -- cut -- If you'll remove explicit delete call then OldNormalNonGcClass will not be destroyed, of course but if you'll make it GC-capable it'll be destroyed without explicit delete. Mix of GC-objects and non-GC objects is inevitable in real world :-(