- 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:
Christoffer Lerno
2025-03-21 17:08:53 +01:00
parent fab00f21a6
commit a03d821602
41 changed files with 208 additions and 167 deletions

View File

@@ -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);