mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
fix(string): use heap allocator for ZString.copy
Use the heap allocator for ZString.copy() instead of the temp allocator to stay consistent across the code base. The temp allocator is used for ZString.tcopy().
This commit is contained in:
committed by
Christoffer Lerno
parent
7dfdb9d061
commit
0cc62058a9
@@ -466,7 +466,7 @@ fn void String.free(&s, Allocator allocator = allocator::heap())
|
||||
|
||||
fn String String.tcopy(s) => s.copy(allocator::temp()) @inline;
|
||||
|
||||
fn String ZString.copy(z, Allocator allocator = allocator::temp())
|
||||
fn String ZString.copy(z, Allocator allocator = allocator::heap())
|
||||
{
|
||||
return z.str_view().copy(allocator) @inline;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user