@pinned classes

bearophile bearophileHUGS at lycos.com
Thu Apr 1 08:24:49 PDT 2010


Justin Spahr-Summers:

> But shouldn't the GC know the size of Foo instances?

Yes, if Foo is a class instance.


>It seems like it should be able to rewrite any GC-managed pointers that point to 'f' or anywhere inside it.<

Maybe it can be done, but in a system language it can become a mess, better to not go there. That's why in the original post I have suggested to allow to unpin only classes, so only a subset of references point to unpinned memory. All pointers, and part of the class references, point to pinned memory. This keeps this thing much simpler, and I think it's useful enough still. Java programmers don't use pointers, and pointers are meant for more manual management.

Bye,
bearophile



More information about the Digitalmars-d mailing list