Re: [PATCH 03/14] hash: use uint32_t for object_id algorithm
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 29, 2025, 09:07 UTC
- Message-ID
- <aQHZbx-2JCnCgL_d@pks.im>
- In-Reply-To
- <aQFg2tvS6Wf7WGd4@fruit.crustytoothpaste.net>
On Wed, Oct 29, 2025 at 12:33:30AM +0000, brian m. carlson wrote:
Show 9 quoted lines
> On 2025-10-28 at 09:16:57, Patrick Steinhardt wrote: > > An alternative would be to introduce an enum and set up bindgen so that > > we can pull this enum into Rust. I'd personally favor that over using an > > uint32_t as it conveys way more meaning. Have you considered this? > > That would lead to problems because we zero-initialize some object IDs > (and you see later in the series what problems that causes) and that > will absolutely not work in Rust, since setting an enum to an invalid > value is undefined behaviour.
We could of course try and represent the uninitialized state with a third enum state. But it would probably make things awfully unergonomic all over the place :/
Patrick