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:
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user