Hacker News new | ask | show | jobs
by shakow 295 days ago
Lazarus does not have a GC AFAIK, it's manual-free.
1 comments

It does seem like they somewhat do now, as of the last several years https://wiki.lazarus.freepascal.org/management_operators

From https://news.ycombinator.com/item?id=19100760 since I'm not a Pascal user:

> The change we're talking about automatically invokes Initialize and Finalize on all types for dynamic allocations / destruction, unless they intentionally circumvent it. Intentional circumvention might include allocating raw memory in a class and treating the class like an array with an index property. In other words, if you declare a raw pointer, allocate untyped memory (e.g. bytes), and handle something back from that memory using a typecast, then you are bypassing automatic allocation and destruction.

> All other ways to make space for complex types (records and classes) as well as types which may hold complex types (arrays and nested fields) will safely and reliably use Initialize and Finalize when needed if they are defined.