Knowledge of managed memory pointers

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 18 23:18:43 PDT 2014


On 4/16/2014 11:55 PM, Manu via Digitalmars-d wrote:
> It occurs to me that a central issue regarding the memory management debate, and
> a major limiting factor with respect to options, is the fact that, currently,
> it's impossible to tell a raw pointer apart from a gc pointer.

No it isn't, in fact, the gc has to be able to tell the difference or it cannot 
do mark/sweep. It tells the difference with "does the pointer point into the gc 
memory pool."


> What about 'hacks' like an unlikely sentinel value at ptr[-1]?

That doesn't work as soon as one increments a pointer.


More information about the Digitalmars-d mailing list