Add allocator::wrap.

This commit is contained in:
Christoffer Lerno
2025-02-13 03:10:46 +01:00
parent a297470887
commit c785572467
2 changed files with 6 additions and 0 deletions

View File

@@ -31,6 +31,11 @@ struct ArenaAllocatorHeader @local
char[?] data;
}
macro ArenaAllocator* wrap(char[] bytes)
{
return ArenaAllocator{}.init(bytes);
}
<*
@require ptr != null
*>

View File

@@ -77,6 +77,7 @@
- Added weakly linked `fmodf`.
- Add `@select` to perform the equivalent of `a ? x : y` at compile time.
- `HashMap` is now `Printable`.
- Add `allocator::wrap` to create an arena allocator on the stack from bytes.
## 0.6.6 Change list