mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
More use of temp allocator.
This commit is contained in:
@@ -68,9 +68,9 @@ fn String join(String[] s, String joiner, Allocator* using = mem::heap())
|
||||
{
|
||||
total_size += str.len;
|
||||
}
|
||||
@stack_mem(256; Allocator* mem)
|
||||
@pool(using)
|
||||
{
|
||||
DString res = dstring::new_with_capacity(total_size, .using = mem);
|
||||
DString res = dstring::tnew_with_capacity(total_size);
|
||||
res.append(s[0]);
|
||||
foreach (String* &str : s[1..])
|
||||
{
|
||||
@@ -416,6 +416,9 @@ fn String! from_wstring(WString wstring, Allocator* using = mem::heap())
|
||||
return from_utf16(utf16, using);
|
||||
}
|
||||
|
||||
fn String! temp_from_wstring(WString wstring) => from_wstring(wstring) @inline;
|
||||
fn String! temp_from_utf16(Char16[] utf16) => temp_from_utf16(utf16) @inline;
|
||||
|
||||
fn usz String.utf8_codepoints(s)
|
||||
{
|
||||
usz len = 0;
|
||||
|
||||
Reference in New Issue
Block a user