Commit 0064fa87 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

boilerplate/heapmem: align on HEAPMEM_PAGE_SIZE for non-bucketed blocks

parent d7256d38
......@@ -426,9 +426,12 @@ void *heapmem_alloc(struct heap_memory *heap, size_t size)
log2size = HEAPMEM_MIN_LOG2;
} else {
log2size = sizeof(size) * CHAR_BIT - 1 - __clz(size);
if (log2size < HEAPMEM_PAGE_SHIFT) {
if (size & (size - 1))
log2size++;
bsize = 1 << log2size;
} else
bsize = __align_to(size, HEAPMEM_PAGE_SIZE);
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment