Sujet : Re: Keeping other stuff with addresses
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : comp.archDate : 04. Dec 2024, 01:56:47
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vio9cf$ei97$6@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla Thunderbird
On 12/3/2024 8:51 AM, Stefan Monnier wrote:
another way to steal bits is over alignment.
Yup. I keep lamenting that Alpha didn't go for bit-addressed memory,
which would have given us 3 extra free bits from alignment (as well as
allowing pointers to bits and bitfields).
;^)
Wrt stealing bits I always revert back to the original pointer when I use it for anything to do with the system. Now, actually using the stolen bits, well we can over align on a _large_ boundary and use them for a smallish reference count and/or version counter. We can use them for state machines in some clever lock-free algorithms. We just need to only use the stolen bits for _our_ logic. Mask them off, get back to the original pointer "value" before we use that pointer for what's its pointing too. Never deference a pointer with stolen bits!!!!!!!!!!!!!!!!!!
Fair enough?