Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Chris M. Thomasson" Newsgroups: comp.arch Subject: Re: Keeping other stuff with addresses Date: Tue, 3 Dec 2024 16:56:47 -0800 Organization: A noiseless patient Spider Lines: 19 Message-ID: References: <20241128185548.000031c9@yahoo.com> <2024Nov30.072829@mips.complang.tuwien.ac.at> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 04 Dec 2024 01:56:48 +0100 (CET) Injection-Info: dont-email.me; posting-host="18f532fff7cb0dbc37a1aea16bf9bfbd"; logging-data="477479"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+xAWFm1VPEJqJpQz5MJ1JzbXdMoRmPFpo=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:xFjQcfsHhHgbmi5/sz7uyY/BK1A= In-Reply-To: Content-Language: en-US Bytes: 2229 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?