core.memory GC interface / specification

Sean Kelly sean at invisibleduck.org
Tue Nov 5 14:27:28 PST 2013


On Nov 5, 2013, at 9:15 AM, Martin Nowak <code at dawg.eu> wrote:
> 
> Most of these are sound like either implementation or documentation bugs. Please file them in bugzilla http://d.puremagic.com/issues/.
> Generally we can't force implementations to provide checks that are possibly expensive to implement. So it might be more appropriate to disallow using non-GC pointer with the GC, but this needs some more thought.

Yes, please suggest implementation or documentation changes as seems appropriate.  It’s safe to assume that every GC must know whether a given pointer is into memory it owns and whether it’s an interior pointer or not, since this is required for garbage collection.  The bigger issue with non-GC pointers passed to GC operations is what the correct response should be.  Some sort of empty or soft failure response or an exception.  It’s been a while, but I think some of the requirements were established based on how memory was used inside Druntime.  There, I believe a soft fail state was important in some cases.


More information about the Digitalmars-d mailing list