A TODO for somebody: Full Reflection Gets You Smarter GC

Russ Lewis spamhole-2001-07-16 at deming-os.org
Mon Nov 20 16:49:32 PST 2006


Sorry, I don't have time to look into this in detail, but I'll post this 
idea so somebody else can explore it:

It is possible to have a smarter GC using compile-time reflection.  I 
haven't had time to explore the members-tuple feature (was it .members, 
or .membersof?), but if that tuple gives us both the offset into the 
type *and* the type of the member, then we can construct a GC which 
knows the types of certain allocations, and knows which elements in 
those allocations are pointers and which are other data.  At least, it 
can know this information in allocations where it knows the type.  In 
cases where it doesn't know the type, it can default to the old scheme 
(treat all possible pointers as pointers).

A thought.



More information about the Digitalmars-d mailing list