Pointer top 16 bits use

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sun May 8 01:46:54 PDT 2016


On Saturday, 7 May 2016 at 12:32:53 UTC, Marco Leise wrote:
> Am Sat, 07 May 2016 12:02:07 +0000
> schrieb Nicholas Wilson <iamthewilsonator at hotmail.com>:
>
>> On Saturday, 7 May 2016 at 09:01:11 UTC, Ali Çehreli wrote:
>> > On 05/06/2016 11:08 PM, Nicholas Wilson wrote:
>> >> In Dicebot's DConf talk
>> >
>> > That was deadalnix. :)
>> >
>> > Ali
>> 
>> Touché.
>
> Too many d's for the day. :) I agree with Benjamin, that we 
> can't rely on the 16-bits being reserved forever.
>
> I have a question about the lower 3 bits OTOH. The minimal GC 
> allocation size is >= 8 bytes, right? I.e. if we set the lower 
> 3 bits to 0b111, and the pointer points to a 4 byte structure, 
> it will still be recognized as an internal pointer due to the 
> overallocation.

You could have allocated an array, so that's a problem, you can 
only use 2 bits. taggedPointer will check for this at compile 
time.

But, yes, LSB are safe to use is you wrap it properly because it 
will be seen as an interior pointer.



More information about the Digitalmars-d mailing list