31 DC_SCOPED(id_map) map = id_map_new(stdalloc_get_ref());
33 id_map_insert(&map, 1,
"Alice");
34 id_map_insert(&map, 2,
"Bob");
35 id_map_insert(&map, 3,
"Charlie");
37 DC_SCOPED(string_builder) sb = string_builder_new(stdalloc_get_ref());
39 fprintf(string_builder_stream(&sb),
"the identities are: ");
42 printf(
"%s\n", string_builder_string(&sb));
59 DC_SCOPED(dbg) debug_alloc = dbg_new(
"hybrid_example", stdout, stdalloc_get_ref());
61 DC_SCOPED(hybrid) hybrid_alloc = hybrid_new(&buf, &debug_alloc);
62 DC_SCOPED(string_builder_hybrid) sb = string_builder_hybrid_new(&hybrid_alloc);
64 fprintf(string_builder_hybrid_stream(&sb),
"This is a small sentence.");
66 printf(
"%s\n", string_builder_hybrid_string(&sb));