[fpc-pascal] Does FPC support garbage collection like Delphi for .NET?
florian at freepascal.org
Mon May 15 08:43:43 CEST 2006
Song Zhiwei wrote:
> There are class TTestA and TTestB:
> TTestB = class end;
> TTestA = class
> B: TTestB;
> constructor Create(BParam: TTestB);
> constructor TTestA.Create(BParam: TTestB);
> B:= BParam;
> A: TTestA;
> A:= TTestA.Create(TTestB.Create);
> A:= nil; // Now, the instances of TTestA and TTestB created in
> // above line can be freed automatically?
> As I known, Delphi for .NET does support garbage collection.
> And the above instances can be freed automatically?
> How about FPC?
No. We don't think that GC fits into the paradigma of pascal because it enables
sloppy and bad programming style.
More information about the fpc-pascal