mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
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:
committed by
Christoffer Lerno
parent
69470b8738
commit
1e38ccdd2b
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user