Fix missing free on GrowableBitSet. init_new/init_temp for GrowableBitSet, LinkedList, List, HashMap, DString, ByteBuffer. Interface to_string renamed to_new_string. Change in allocator usage, malloc is now heap. Added new_array, new_zero_array, new, new_clear, clone. Concat => concat_new. string::printf => string::new_format, string::tprintf => string::tformat. "to_*" are now "to_new_*" and "to_temp_*". "from_*" is "new_from*"

This commit is contained in:
Christoffer Lerno
2023-11-06 23:20:41 +01:00
committed by Christoffer Lerno
parent 69470b8738
commit 1e38ccdd2b
77 changed files with 1049 additions and 1412 deletions

View File

@@ -9,9 +9,9 @@ fn String add(String s, Allocator* a, int x)
tmp = "foo".tconcat(s);
tmp = add(tmp, a, x - 1);
};
ulong* y = malloc(ulong, .using = mem::temp());
ulong* y = mem::new_temp(ulong);
*y = 0xAAAA_AAAA_AAAA_AAAA;
return tmp.concat("a", .using = a);
return tmp.concat("a", .allocator = a);
}
fn String breakit(String s, Allocator* a)
@@ -26,10 +26,10 @@ fn String inner2(String s, Allocator* a)
{
@pool(a)
{
ulong* z1 = tmalloc(ulong);
ulong* z1 = mem::new_temp(ulong);
*z1 = 0xAAAA_AAAA_AAAA_AAAA;
String y = inner3(s, a);
ulong* z = tmalloc(ulong);
ulong* z = mem::new_temp(ulong);
*z = 0xAAAA_AAAA_AAAA_AAAA;
return y;
};
@@ -39,10 +39,10 @@ fn String inner3(String s, Allocator* a)
{
@pool(a)
{
ulong* z1 = tmalloc(ulong);
ulong* z1 = mem::new_temp(ulong);
*z1 = 0xAAAA_AAAA_AAAA_AAAA;
String y = inner4(s, a);
ulong* z = tmalloc(ulong);
ulong* z = mem::new_temp(ulong);
*z = 0xAAAA_AAAA_AAAA_AAAA;
return y;
};