- assert ((uintptr_t) p >= (uintptr_t) vhp_base);
- heap_ptr h = (heap_ptr) ((uintptr_t) p - (uintptr_t) vhp_base);
- return h;
-}
-
-static inline object *
-heap_alloc (uint32_t len)
-{
- enum
- { DOPE_LEN = 1 };
- char *p = vhp;
- vhp += (len + DOPE_LEN) << 4;
- return (object *) p;
+ // divide by 2 (rounding up), then add one for dope
+ return heap_alloc (((len + 1) >> 1) + 1);