- 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

@@ -40,8 +40,8 @@ fn char[]? decode(Allocator allocator, char[] src, char padding = DEFAULT_PAD, B
return decode_buffer(src, dst, padding, alphabet);
}
fn String? tencode(char[] code, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD) @inline => encode(tmem(), code, padding, alphabet);
fn char[]? tdecode(char[] code, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD) @inline => decode(tmem(), code, padding, alphabet);
fn String? tencode(char[] code, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD) @inline => encode(tmem, code, padding, alphabet);
fn char[]? tdecode(char[] code, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD) @inline => decode(tmem, code, padding, alphabet);
<*
Calculate the length in bytes of the decoded data.

View File

@@ -55,8 +55,8 @@ fn char[]? decode(Allocator allocator, char[] src, char padding = DEFAULT_PAD, B
return decode_buffer(src, dst, padding, alphabet);
}
fn String tencode(char[] code, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD) @inline => encode(tmem(), code, padding, alphabet);
fn char[]? tdecode(char[] code, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD) @inline => decode(tmem(), code, padding, alphabet);
fn String tencode(char[] code, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD) @inline => encode(tmem, code, padding, alphabet);
fn char[]? tdecode(char[] code, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD) @inline => decode(tmem, code, padding, alphabet);
<*

View File

@@ -51,7 +51,7 @@ fn CsvRow? CsvReader.read_row(self, Allocator allocator)
fn CsvRow? CsvReader.tread_row(self)
{
return self.read_row(tmem()) @inline;
return self.read_row(tmem) @inline;
}
<*

View File

@@ -25,8 +25,8 @@ fn char[]? decode(Allocator allocator, char[] code)
return data[:decode_bytes(code, data)!];
}
fn String tencode(char[] code) @inline => encode(tmem(), code);
fn char[]? tdecode(char[] code) @inline => decode(tmem(), code);
fn String tencode(char[] code) @inline => encode(tmem, code);
fn char[]? tdecode(char[] code) @inline => decode(tmem, code);
<*

View File

@@ -15,7 +15,7 @@ fn Object*? parse_string(Allocator allocator, String s)
fn Object*? tparse_string(String s)
{
return parse(tmem(), (ByteReader){}.init(s));
return parse(tmem, (ByteReader){}.init(s));
}
fn Object*? parse(Allocator allocator, InStream s)
@@ -32,7 +32,7 @@ fn Object*? parse(Allocator allocator, InStream s)
fn Object*? tparse(InStream s)
{
return parse(tmem(), s);
return parse(tmem, s);
}
// -- Implementation follows --