Among all trolling subject in forums, you'll find out the great Garbage Collection theme.
And, in Delphi, there is no such collector. We handle memory in several ways:
- Creating static variables - e.g. on the stack, inside a
- Creating objects with
classinstances allocated on heap - in at least three ways: with a
try..finally Freeblock, with a
TComponentownership model in the VCL, or by using an
interface(which creates an hidden
- Creating reference-counted variables, i.e.
variantkind of variables.
It is a bit complex, but it is also deadly powerful. You have several memory allocation models at hand, which can be very handy if you want to tune your performance and let program scale. Just like manual recycling at home will save the planet. Some programmers will tell you that it's a waste of cell brain, typing and time. Linux kernel gurus would not say so, I'm afraid.
Then came the big Apple company, which presented its new ARC model (introduced in Mac OS X 10.7 Lion) as a huge benefit for Objective-C in comparison with the Garbage Collection model. And let's face it: this ARC just sounds like the Delphi memory model.