[kutil] Fix failing heap allocator tests
The tests clearly haven't even been built in a while. I've added a helper script to the project root. Also added a kassert() handler that will allow tests to catch or fail on asserts.
This commit is contained in:
@@ -77,8 +77,10 @@ heap_allocator::allocate(size_t length)
|
||||
if (length == 0)
|
||||
return nullptr;
|
||||
|
||||
const unsigned clz = __builtin_clzll(total);
|
||||
const unsigned order = 64 - clz;
|
||||
const unsigned clz = __builtin_clzll(total - 1);
|
||||
unsigned order = 64 - clz;
|
||||
if (order < min_order)
|
||||
order = min_order;
|
||||
|
||||
kassert(order <= max_order, "Tried to allocate a block bigger than max_order");
|
||||
if (order > max_order)
|
||||
|
||||
Reference in New Issue
Block a user