third draft: add bitfields to D

IchorDev zxinsworld at gmail.com
Sat Jul 20 17:32:40 UTC 2024


On Thursday, 18 July 2024 at 08:52:35 UTC, Dom DiSc wrote:
> Why? As pointers are 64bit, the highest three bits will never 
> be used anyway (at least not for the next 20 years).

This is a stupidly unreliable and highly system-dependant hack: 
https://stackoverflow.com/a/18426582
How will you make this work on 32-bit systems? How will you make 
this work on iOS—a 64-bit system where pointers are 32-bit? How 
will you make this work on systems with 64-bit pointers that have 
all of their bits reserved?

> Simply shift all pointers 3bits to the right and use the lower 
> 3 bits to indicate the bitoffset.

That will only work if they are aligned to 8-byte boundaries.


More information about the dip.development mailing list