diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.zig | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig index fd77d30..1de51f4 100644 --- a/src/main.zig +++ b/src/main.zig @@ -64,13 +64,12 @@ const SaprusMessage = union(SaprusPacketType) {  };  pub fn main() !void { -    const DBA = std.heap.DebugAllocator(.{}); -    var dba: ?DBA = if (comptime is_debug) DBA.init else null; +    var dba: ?DebugAllocator = if (comptime is_debug) DebugAllocator.init else null;      defer if (dba) |*d| {          _ = d.deinit();      }; -    var allocator = if (dba) |*d| d.allocator() else std.heap.smp_allocator; +    var gpa = if (dba) |*d| d.allocator() else std.heap.smp_allocator;      const msg = SaprusMessage{          .relay = .{ @@ -79,8 +78,8 @@ pub fn main() !void {          },      }; -    const msg_bytes = try msg.toBytes(allocator); -    defer allocator.free(msg_bytes); +    const msg_bytes = try msg.toBytes(gpa); +    defer gpa.free(msg_bytes);      try network.init();      defer network.deinit(); @@ -109,5 +108,6 @@ pub fn main() !void {  const builtin = @import("builtin");  const std = @import("std");  const Allocator = std.mem.Allocator; +const DebugAllocator = std.heap.DebugAllocator(.{});  const network = @import("network");  | 
