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
@@ -38,7 +38,7 @@ fn Doc! read_doc(String url)
|
||||
if (url.contains("head-missing")) return { };
|
||||
if (url.contains("title-missing")) return { .head = new_head_val({}) };
|
||||
if (url.contains("title-empty")) return { .head = new_head_val({ .title = new_string_val("")}) };
|
||||
return { .head = new_head_val({ .title = new_string_val(string::printf("Title of %s", url)) }) };
|
||||
return { .head = new_head_val({ .title = new_string_val(string::new_format("Title of %s", url)) }) };
|
||||
}
|
||||
|
||||
fn Summary build_summary(Doc doc)
|
||||
@@ -75,7 +75,7 @@ fn void main()
|
||||
{
|
||||
const String[] URLS = { "good", "title-empty", "title-missing", "head-missing", "fail" };
|
||||
DynamicArenaAllocator dynamic_arena;
|
||||
dynamic_arena.init(1024);
|
||||
dynamic_arena.init(1024, mem::heap());
|
||||
OutStream* out = io::stdout();
|
||||
foreach (String url : URLS)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user