- 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

@@ -63,7 +63,7 @@ fn String InetAddress.to_string(&self, Allocator allocator)
fn String InetAddress.to_tstring(&self)
{
return string::format(tmem(), "%s", *self);
return string::format(tmem, "%s", *self);
}
fn InetAddress? ipv6_from_str(String s)

View File

@@ -47,7 +47,7 @@ struct Url(Printable)
@require url_string.len > 0 : "the url_string must be len 1 or more"
@return "the parsed Url"
*>
fn Url? tparse(String url_string) => parse(tmem(), url_string);
fn Url? tparse(String url_string) => parse(tmem, url_string);
<*
Parse a URL string into a Url struct.
@@ -252,7 +252,7 @@ struct UrlQueryValues
@param [in] query
@return "a UrlQueryValues HashMap"
*>
fn UrlQueryValues parse_query_to_temp(String query) => parse_query(tmem(), query);
fn UrlQueryValues parse_query_to_temp(String query) => parse_query(tmem, query);
<*
Parse the query parameters of the Url into a UrlQueryValues map.

View File

@@ -100,7 +100,7 @@ fn String encode(Allocator allocator, String s, UrlEncodingMode mode) => @pool()
@param mode : "Url encoding mode"
@return "Percent-encoded String"
*>
fn String tencode(String s, UrlEncodingMode mode) => encode(tmem(), s, mode);
fn String tencode(String s, UrlEncodingMode mode) => encode(tmem, s, mode);
<*
Calculate the length of the percent-decoded string.
@@ -167,4 +167,4 @@ fn String? decode(Allocator allocator, String s, UrlEncodingMode mode) => @pool
@param mode : "Url encoding mode"
@return "Percent-decoded String"
*>
fn String? tdecode(String s, UrlEncodingMode mode) => decode(tmem(), s, mode);
fn String? tdecode(String s, UrlEncodingMode mode) => decode(tmem, s, mode);