mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +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:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
<*
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
<*
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
<*
|
||||
|
||||
@@ -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 --
|
||||
|
||||
Reference in New Issue
Block a user