Re: [PATCH v11 4/5] rust: id_pool: do not round capacity up to BitmapVec::MAX_INLINE_LEN

From: Alexandre Courbot

Date: Thu Nov 12 2026 - 08:38:27 EST


On Thu Nov 12, 2026 at 5:47 AM JST, Yury Norov wrote:
>> Forbidding zero-sized pools would actually require *more* code in this
>> patch to enforce that rule, and would not allow us to remove any in
>> exchange afaict.
>
> I trust you here. Maybe declaring nbits in the allocation API as
> NonZero would help - IDK... I just want to make sure we're not
> bloating the implementation for unneeded and confusing functionality.

I think the current code is pretty much as simple as we can make it for
our use-case.

Of course we can always tune it and even update the API if we find out
it doesn't work as well as we thought, or that allowing zero-sized pools
create issues. But if we forbid them preemptively we would actually be
adding more complexity, which makes me think the current approach looks
right.