hi, Jan!In order to consider the last word, I think we should use __map_depth()
在 2025/7/30 21:03, Jan Kara 写道:
I think having two APIs will be even more confusing than the current state.
But as I wrote I think you can have API to specify shallow depth in total
size and in sbitmap_queue_get_shallow() do:
shallow_per_word = (shallow_depth << sb->shift) / sb->depth;
And then it's not possible to calculate this rounding index easily. Howrounding_index = shallow_depth - shallow_per_word * sb->depth;
Yes, you're right, I did not get your idea before. Thanks for the explanation
and allow depth shallow_per_word + 1 if current index < rounding_index and
exactly shallow_per_word if current index >= rounding_index. This will
still evenly distribute shallow depth among words and I don't think the
additional overhead of the several arithmetic operations will be visible.
and the suggestion :) Will follow this idea in the next version.
Thanks
.