template <typename Config> struct SizeClassMapBase {
static u32 getMaxCachedHint(uptr Size) {
- DCHECK_LE(Size, MaxSize);
+ DCHECK_LE(Size, (1UL << Config::MaxSizeLog) + Chunk::getHeaderSize());
DCHECK_NE(Size, 0);
u32 N;
// Force a 32-bit division if the template parameters allow for it.
constexpr static u8 computeClassId(uptr Size) {
for (uptr i = 0; i != ClassesSize; ++i) {
if (Size <= Config::Classes[i])
- return i + 1;
+ return static_cast<u8>(i + 1);
}
- return -1;
+ return static_cast<u8>(-1);
}
constexpr static uptr getTableSize() {