diff options
Diffstat (limited to 'mem.c')
-rw-r--r-- | mem.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; +} |