Re: Garbage Collection




"Remy Lebeau (TeamB)" <no.spam@xxxxxxxxxxx> wrote in message
news:478e59c3@xxxxxxxxxxxxxxxxxxxxxxxxx

"Sanyin" <prevodilac@xxxxxxxxxxx> wrote in message
news:478e0c5b$1@xxxxxxxxxxxxxxxxxxxxxxxxx

Delphi has GC, for arrays, strings, records.
So it has 3/4 of it :)

Garbage collection is when freed memory is marked as unused but remains
allocated so it can't be reused right away, and then a separate background
collector process goes through at frequent intervals returning marked
memory back to the system for later reallocation. That is not how Delphi
manages its memory in Win32. Freed memory is available for immediate
reuse. There is no marking involved. There is no background collector
running. Records and static arrays that are not dynamically allocated
reside on the stack and are "freed" when the stack is cleared. Strings
and DynamicArrays are reference counted and freed immediately when all
references to them are gone. None of that is related to garbage
collection.

Yes, but at least, lifetime management of classes is more than needed.If
exists for arrays and records, than why not for classes.Most memory leaking
is from classes, and you can always use pointer and manual allocating...


.



Relevant Pages