Regionlist overhaul: Refactor regionlist init

parent a269fb42
......@@ -132,18 +132,13 @@ regl_cram(const uint8_t bits, int8_t cram)
}
static struct regl *
regl_alloc_bits(buddy_t *membuddy, const uint8_t bits, int8_t cram,
regl_init(buddy_t *membuddy, struct buddy_ptr_page alloc,
struct regionlist **rlp)
{
struct buddy_ptr_page alloc;
struct regionlist *rl;
struct regl *r;
size_t sz, b;
alloc = buddy_alloc1_ptr_page_wait(membuddy, FEP_MEM_FREE, bits,
regl_cram(bits, cram));
AN(alloc.ptr);
sz = (size_t)1 << alloc.bits;
assert(sz >= (sizeof *r + sizeof *rl));
......@@ -173,6 +168,19 @@ regl_alloc_bits(buddy_t *membuddy, const uint8_t bits, int8_t cram,
return (r);
}
static struct regl *
regl_alloc_bits(buddy_t *membuddy, const uint8_t bits, int8_t cram,
struct regionlist **rlp)
{
struct buddy_ptr_page alloc;
alloc = buddy_alloc1_ptr_page_wait(membuddy, FEP_MEM_FREE, bits,
regl_cram(bits, cram));
AN(alloc.ptr);
return (regl_init(membuddy, alloc, rlp));
}
#ifdef DEBUG
static const int8_t regl_bits = 12;
#else
......
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