diff options
Diffstat (limited to 'src/Package.zig')
| -rw-r--r-- | src/Package.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Package.zig b/src/Package.zig index 976e92d096..df894280a9 100644 --- a/src/Package.zig +++ b/src/Package.zig @@ -21,7 +21,7 @@ root_src_directory_owned: bool = false, /// Allocate a Package. No references to the slices passed are kept. pub fn create( - gpa: *Allocator, + gpa: Allocator, /// Null indicates the current working directory root_src_dir_path: ?[]const u8, /// Relative to root_src_dir_path @@ -49,7 +49,7 @@ pub fn create( } pub fn createWithDir( - gpa: *Allocator, + gpa: Allocator, directory: Compilation.Directory, /// Relative to `directory`. If null, means `directory` is the root src dir /// and is owned externally. @@ -87,7 +87,7 @@ pub fn createWithDir( /// Free all memory associated with this package. It does not destroy any packages /// inside its table; the caller is responsible for calling destroy() on them. -pub fn destroy(pkg: *Package, gpa: *Allocator) void { +pub fn destroy(pkg: *Package, gpa: Allocator) void { gpa.free(pkg.root_src_path); if (pkg.root_src_directory_owned) { @@ -104,7 +104,7 @@ pub fn destroy(pkg: *Package, gpa: *Allocator) void { } /// Only frees memory associated with the table. -pub fn deinitTable(pkg: *Package, gpa: *Allocator) void { +pub fn deinitTable(pkg: *Package, gpa: Allocator) void { var it = pkg.table.keyIterator(); while (it.next()) |key| { gpa.free(key.*); @@ -113,13 +113,13 @@ pub fn deinitTable(pkg: *Package, gpa: *Allocator) void { pkg.table.deinit(gpa); } -pub fn add(pkg: *Package, gpa: *Allocator, name: []const u8, package: *Package) !void { +pub fn add(pkg: *Package, gpa: Allocator, name: []const u8, package: *Package) !void { try pkg.table.ensureUnusedCapacity(gpa, 1); const name_dupe = try gpa.dupe(u8, name); pkg.table.putAssumeCapacityNoClobber(name_dupe, package); } -pub fn addAndAdopt(parent: *Package, gpa: *Allocator, name: []const u8, child: *Package) !void { +pub fn addAndAdopt(parent: *Package, gpa: Allocator, name: []const u8, child: *Package) !void { assert(child.parent == null); // make up your mind, who is the parent?? child.parent = parent; return parent.add(gpa, name, child); |
