offset_allocator/
ext.rs

1//! Extension functions not present in the original C++ `OffsetAllocator`.
2
3use crate::small_float;
4
5/// Returns the minimum allocator size needed to hold an object of the given
6/// size.
7pub fn min_allocator_size(needed_object_size: u32) -> u32 {
8    small_float::float_to_uint(small_float::uint_to_float_round_up(needed_object_size))
9}