This commit is contained in:
pfg
2025-01-02 15:51:17 -08:00
parent f0f8e9cdb9
commit f3d0e2e8ac

View File

@@ -54,17 +54,16 @@ pub const ModuleInfoDeserialized = struct {
dead: bool = false,
pub fn deinit(self: *ModuleInfoDeserialized) void {
// switch (self.owner) {
// .module_info => {
// const mi: *ModuleInfo = @fieldParentPtr("_deserialized", self);
// mi.destroy();
// },
// .allocated_slice => |as| {
// as.allocator.free(as.slice);
// as.allocator.destroy(self);
// },
// }
self.dead = true;
switch (self.owner) {
.module_info => {
const mi: *ModuleInfo = @fieldParentPtr("_deserialized", self);
mi.destroy();
},
.allocated_slice => |as| {
as.allocator.free(as.slice);
as.allocator.destroy(self);
},
}
}
inline fn eat(rem: *[]const u8, len: usize) ![]const u8 {
@@ -227,7 +226,6 @@ pub const ModuleInfo = struct {
}
pub fn create(gpa: std.mem.Allocator) !*ModuleInfo {
std.log.info("ModuleInfo.create", .{});
const res = try gpa.create(ModuleInfo);
res.* = ModuleInfo.init(gpa);
return res;