mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add allocator::wrap.
This commit is contained in:
@@ -31,6 +31,11 @@ struct ArenaAllocatorHeader @local
|
||||
char[?] data;
|
||||
}
|
||||
|
||||
macro ArenaAllocator* wrap(char[] bytes)
|
||||
{
|
||||
return ArenaAllocator{}.init(bytes);
|
||||
}
|
||||
|
||||
<*
|
||||
@require ptr != null
|
||||
*>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user