mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
- Use @pool_init() to set up a temp pool on a thread. Only the main thread has implicit temp pool setup.
- `tmem` is now a variable.
This commit is contained in:
@@ -9,7 +9,7 @@ enum Foo
|
||||
|
||||
fn void print_pages()
|
||||
{
|
||||
tmem().print_pages(io::stdout())!!;
|
||||
tmem.print_pages(io::stdout())!!;
|
||||
}
|
||||
|
||||
fn void setstring(char* dst, String str)
|
||||
@@ -63,7 +63,7 @@ fn void main()
|
||||
io::printf("First big: %p\n", first_big);
|
||||
print_pages();
|
||||
};
|
||||
mem::@scoped(tmem())
|
||||
mem::@scoped(tmem)
|
||||
{
|
||||
io::printf("Malloc: %p\n", (void*)malloc(23));
|
||||
io::printf("Malloc: %p\n", (void*)malloc(23));
|
||||
@@ -73,8 +73,8 @@ fn void main()
|
||||
{
|
||||
io::printf("Talloc: %p\n", (void*)tmalloc(22));
|
||||
};
|
||||
testAllocator(tmem(), 126);
|
||||
testAllocator(tmem(), 12600);
|
||||
testAllocator(tmem, 126);
|
||||
testAllocator(tmem, 12600);
|
||||
ArenaAllocator aa;
|
||||
aa.init(&&char[1024] {});
|
||||
testAllocator(&aa, 126);
|
||||
|
||||
Reference in New Issue
Block a user