cptr::detail::size_class

The smallest class of at least bytes (1 to kMaxSmall) whose size is a multiple of align (a power of two up to kMaxSmall). Above 256 bytes there are four classes per power of two p, p + p/4 ... 2p, so the class follows from the top three bits of bytes - 1, and as they are multiples of p/4 >= 64, only alignments above 64 need a short search from there.

Synopsis

Declared in <cptr/cage.hpp>

constexpr
int
size_class(
    std::size_t bytes,
    std::size_t align) noexcept;