From 7874ddf6b61283b4c92ccf6e3234ece1ca39755f Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 16 Jun 2020 13:33:19 -0700 Subject: [PATCH] valgrinded --- zig-ecs/build.zig | 1 + zig-ecs/src/process/scheduler.zig | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/zig-ecs/build.zig b/zig-ecs/build.zig index de4d04e..92cdbb0 100644 --- a/zig-ecs/build.zig +++ b/zig-ecs/build.zig @@ -16,6 +16,7 @@ pub fn build(b: *Builder) void { var exe = b.addExecutable(name, source); exe.setBuildMode(b.standardReleaseOptions()); exe.addPackagePath("ecs", "src/ecs.zig"); + exe.linkSystemLibrary("c"); const run_cmd = exe.run(); const exe_step = b.step(name, b.fmt("run {}.zig", .{name})); diff --git a/zig-ecs/src/process/scheduler.zig b/zig-ecs/src/process/scheduler.zig index ae09087..a9ce9bc 100644 --- a/zig-ecs/src/process/scheduler.zig +++ b/zig-ecs/src/process/scheduler.zig @@ -21,11 +21,11 @@ pub const Scheduler = struct { // get a closure so that we can safely deinit this later proc.process.deinit = struct { - fn deinit(process: *Process, allocator: *std.mem.Allocator) void { + fn deinit(process: *Process, alloc: *std.mem.Allocator) void { if (process.next) |next_process| { - next_process.deinit(next_process, allocator); + next_process.deinit(next_process, alloc); } - allocator.destroy(@fieldParentPtr(T, "process", process)); + alloc.destroy(@fieldParentPtr(T, "process", process)); } }.deinit;