sx sync: catch bindings take parens; Allocator.alloc -> alloc_bytes
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user