Add DString init.

This commit is contained in:
Christoffer Lerno
2023-03-06 09:12:52 +01:00
parent a4231823df
commit 9eee250b10
21 changed files with 402 additions and 402 deletions

View File

@@ -13,7 +13,7 @@ struct ByteWriter
* @require writer.bytes.len == 0 "Init may not run on on already initialized data"
* @ensure allocator != null, index == 0
**/
fn void ByteWriter.init(ByteWriter* writer, Allocator* allocator = mem::current_allocator())
fn void ByteWriter.init(ByteWriter* writer, Allocator* allocator = mem::heap())
{
*writer = { .bytes = {}, .allocator = allocator };
}
@@ -25,7 +25,7 @@ fn void ByteWriter.init(ByteWriter* writer, Allocator* allocator = mem::current_
**/
fn void ByteWriter.tinit(ByteWriter* writer)
{
*writer = { .bytes = {}, .allocator = mem::temp_allocator() };
*writer = { .bytes = {}, .allocator = mem::temp() };
}
fn Stream ByteWriter.as_stream(ByteWriter* writer)