diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-27 17:45:13 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-27 17:45:13 +0200 |
| commit | 3b0e9424a66058da82d11d432da886ec7b6ce7eb (patch) | |
| tree | 0ad906e3b7d945405cdfeb9ff95b02546e1ed4bb /src/eval/list.zig | |
| parent | ef5c0341ca15f6862294802103b02992b29609e8 (diff) | |
perf(eval): reduce memory syscall
Diffstat (limited to 'src/eval/list.zig')
| -rw-r--r-- | src/eval/list.zig | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/eval/list.zig b/src/eval/list.zig index 08f180a..06b7af7 100644 --- a/src/eval/list.zig +++ b/src/eval/list.zig @@ -18,21 +18,10 @@ fn List(comptime tag: []const u8) type { } pub fn element(self: *Self) Element { - return .{ .ptr = self, .vtable = .{ .deinit = destroy, .html = html } }; + return .{ .ptr = self, .vtable = .{ .html = html } }; } - pub fn deinit(self: *Self, alloc: Allocator) void { - destroy(self, alloc); - } - - fn destroy(context: *anyopaque, alloc: Allocator) void { - var self: *Self = @ptrCast(@alignCast(context)); - for (self.content.items) |it| it.deinit(alloc); - self.content.deinit(alloc); - alloc.destroy(self); - } - - fn html(context: *anyopaque, alloc: Allocator) HTML.Error!HTML { + fn html(context: *anyopaque, alloc: Allocator) HTML.Error!HTML { const self: *Self = @ptrCast(@alignCast(context)); var el = try HTML.Content.init(alloc, tag); for (self.content.items) |it| { |
