From 5b522325bdc0af283ca6d3ec7d71908858d91b33 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Tue, 6 Aug 2024 18:12:16 +0100 Subject: deastnodeify form compilers --- mem.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mem.c') diff --git a/mem.c b/mem.c index 225834d..2c42758 100644 --- a/mem.c +++ b/mem.c @@ -22,3 +22,10 @@ Obj *alloc_obj(State *S, size_t sz, ObjTy oty) { o->oty = oty; return o; } + + +size_t next_pwrof2(size_t x) { + size_t p = 1; + while (p < x) p <<= 1; + return p; +} -- cgit v1.2.3