X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Falloc.h;h=58ee8081e391dde43b3738420666453df668c6b4;hb=58a5ffdfec139a0c9d399f603b77a764ae8607f7;hp=2c7e6a041b56dae49d70735184335bc7bce17865;hpb=3eadff410d2d08246d6f195ef209ed9d88c99be5;p=muddle-interpreter.git diff --git a/src/alloc.h b/src/alloc.h index 2c7e6a0..58ee808 100644 --- a/src/alloc.h +++ b/src/alloc.h @@ -34,10 +34,15 @@ object *HEAP_OBJECT (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); +} // given a headerless array of objects of known size, // copy it backwards into newly-allocated pool space -pool_ptr pool_copy_array_rev (const pool_object *objs, uint32_t len); -heap_ptr heap_copy_array_rev (const object *objs, uint32_t len); +pool_ptr pool_copy_array_rev (const pool_object * objs, uint32_t len); +heap_ptr heap_copy_array_rev (const object * objs, uint32_t len); #endif // ALLOC_H