Garbage collector collects live objects

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Dec 9 12:18:01 PST 2014


On 12/09/2014 11:56 AM, Steven Schveighoffer wrote:

 >> i checked attributes for GC block holding this array:
 >>
 >> ```
 >> FINALIZE NO_SCAN NO_MOVE APPENDABLE NO_INTERIOR
 >> ```
 >>
 >
 > That does not sound right at all. No block should ever have both
 > FINALIZE (reserved for objects only) and APPENDABLE (reserved for arrays
 > only).

FINALIZE and APPENDABLE together sounds like "an array that holds class 
objects."

I think I get it as I write this: Do we mean that the array should 
always hold class references and the class objects should live on other 
blocks? If so, the memory block for the objects can be marked as 
FINALIZE? What block should be APPENDABLE?

Of course, this may be all in the documentation but I can't understand 
it. ;) Here is what is says for FINALIZE: "Finalize the data in this 
block on collect." (I will study that part a little more. :p)

   http://dlang.org/phobos/core_memory.html#.GC.BlkAttr.FINALIZE

Ali



More information about the Digitalmars-d-learn mailing list