Implement OBLISTs
[muddle-interpreter.git] / src / alloc.h
index 58ee8081e391dde43b3738420666453df668c6b4..bd7c46b697f02900505b4a3827af99c56ecb00ae 100644 (file)
@@ -28,16 +28,19 @@ typedef int32_t heap_ptr;
 
 typedef union pool_object pool_object;
 typedef union object object;
+typedef union uv_val uv_val;
 
 pool_object *POOL_OBJECT (pool_ptr p);
 object *HEAP_OBJECT (heap_ptr p);
+uv_val *UV_VAL (heap_ptr p);
 
 pool_ptr pool_alloc (uint32_t len);
 heap_ptr heap_alloc (uint32_t len);
 inline static heap_ptr
 heap_alloc_uv (uint32_t len)
 {
-  return heap_alloc ((len + 1) >> 1);
+  // divide by 2 (rounding up), then add one for dope
+  return heap_alloc (((len + 1) >> 1) + 1);
 }
 
 // given a headerless array of objects of known size,