sx sync: catch bindings take parens; Allocator.alloc -> alloc_bytes

This commit is contained in:
agra
2026-06-11 22:58:22 +03:00
parent ea2cf14f48
commit a93a9a922b
5 changed files with 16 additions and 16 deletions

View File

@@ -83,7 +83,7 @@ Manifest :: struct {
// Copy `s` into `alloc`-owned, null-terminated storage so the manifest
// survives the source bytes / parse scratch being dropped.
dup_str :: (s: string, alloc: Allocator) -> string {
raw : [*]u8 = xx alloc.alloc(s.len + 1);
raw : [*]u8 = xx alloc.alloc_bytes(s.len + 1);
if s.len > 0 { memcpy(raw, s.ptr, s.len); }
raw[s.len] = 0;
return string.{ ptr = raw, len = s.len };

View File

@@ -237,7 +237,7 @@ save :: (self: *Repo, root_dir: string) -> !LoadErr {
// Copy `s` into `alloc`-owned, null-terminated storage so it survives the
// parse scratch / source buffer being freed.
db_dup_str :: (s: string, alloc: Allocator) -> string {
raw : [*]u8 = xx alloc.alloc(s.len + 1);
raw : [*]u8 = xx alloc.alloc_bytes(s.len + 1);
if s.len > 0 { memcpy(raw, s.ptr, s.len); }
raw[s.len] = 0;
return string.{ ptr = raw, len = s.len };