Skip to content
Snippets Groups Projects
Commit ac16755e authored by Avi Kivity's avatar Avi Kivity
Browse files

mempool: compute pool count instead of hardcoding it

parent beb8c6aa
No related branches found
No related tags found
No related merge requests found
#include "mempool.hh"
#include "ilog2.hh"
#include <cassert>
#include <cstdint>
#include <new>
......@@ -89,8 +90,8 @@ pool* pool::from_object(void* object)
return header->owner;
}
// FIXME: compute 12
malloc_pool malloc_pools[12] __attribute__((init_priority(12000)));
malloc_pool malloc_pools[ilog2_roundup_constexpr(page_size)]
__attribute__((init_priority(12000)));
malloc_pool::malloc_pool()
: pool(compute_object_size(this - malloc_pools))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment