mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Temp allocator now supports more than 2 in-flight stacks.
- Printing stacktrace uses its own temp allocator. - `@pool` no longer takes an argument. - `Allocator` interface removes `mark` and `reset`. - DynamicArenaAllocator has changed init function. - Added `BackedArenaAllocator` which is allocated to a fixed size, then allocates on the backing allocator and supports mark/reset.
This commit is contained in:
@@ -59,7 +59,7 @@ fn ZString tformat_zstr(String fmt, args...)
|
||||
@param [inout] allocator : `The allocator to use`
|
||||
@param [in] fmt : `The formatting string`
|
||||
*>
|
||||
fn String format(Allocator allocator, String fmt, args...) => @pool(allocator)
|
||||
fn String format(Allocator allocator, String fmt, args...) => @pool()
|
||||
{
|
||||
DString str = dstring::temp_with_capacity(fmt.len + args.len * 8);
|
||||
str.appendf(fmt, ...args);
|
||||
@@ -104,7 +104,7 @@ fn String join(Allocator allocator, String[] s, String joiner)
|
||||
{
|
||||
total_size += str.len;
|
||||
}
|
||||
@pool(allocator)
|
||||
@pool()
|
||||
{
|
||||
DString res = dstring::temp_with_capacity(total_size);
|
||||
res.append(s[0]);
|
||||
|
||||
Reference in New Issue
Block a user