mem: rename Allocator primitives to alloc_bytes/dealloc_bytes (Phase 4 naming pulled forward, Agra-approved)
This commit is contained in:
@@ -61,7 +61,7 @@ ctrl_raises :: (b: u8, alloc: Allocator) -> bool {
|
||||
// bytes are backed by `alloc` (string values are VIEWS, so they must
|
||||
// outlive `build`).
|
||||
build :: (alloc: Allocator) -> Value {
|
||||
ebytes : [*]u8 = xx alloc.alloc(8);
|
||||
ebytes : [*]u8 = xx alloc.alloc_bytes(8);
|
||||
ebytes[0] = 34; // " -> \"
|
||||
ebytes[1] = 92; // \ -> \\
|
||||
ebytes[2] = 8; // BS -> \b
|
||||
@@ -176,7 +176,7 @@ main :: () -> ! {
|
||||
report("dec-esc-ctrl", ectrl.str == string.{ ptr = @cexp[0], len = 3 });
|
||||
|
||||
// Raw multi-byte UTF-8 (>= 0x80) round-trips writer -> reader unchanged.
|
||||
ubytes : [*]u8 = xx a.alloc(7);
|
||||
ubytes : [*]u8 = xx a.alloc_bytes(7);
|
||||
ubytes[0] = 0x41; ubytes[1] = 0xC3; ubytes[2] = 0xA9;
|
||||
ubytes[3] = 0xF0; ubytes[4] = 0x9F; ubytes[5] = 0x98; ubytes[6] = 0x80;
|
||||
uval : Value = .str(string.{ ptr = ubytes, len = 7 });
|
||||
|
||||
Reference in New Issue
Block a user