Garbage collector memory leak "feature"?

Sean Kelly sean at f4.ca
Wed Oct 10 16:02:39 PDT 2007


David Brown wrote:
> 
> I'm not sure I understand why these restrictions aren't possible under D.
> They might not be possible with the current implementation, but I didn't
> see anything in the language spec that requires inexactness to the GC.
> 
> It might not meet some performance or other memory requirements some users
> have, but it should be possible to make the GC exact.

With one stipulation, I believe this could be true of blocks allocated 
by the GC.  Type information could be supplied by the runtime, etc, to 
allow exact scanning.  The stipulation being that D users may have a 
desire or a need to occasionally allocate untyped memory blocks, such as 
void[].  In these cases, conservative scanning would be necessary.

However, that still leaves the stack as an unknown element.  At present, 
the GC doesn't know anything about what a pointer-sized stack value 
represents, and I don't see how this could be communicated or 
determined.  But perhaps this is just a gap in my knowledge of GC theory.


Sean



More information about the Digitalmars-d mailing list