Skip to content

Commit

Permalink
App: Use GPA in debug and c_allocator in release
Browse files Browse the repository at this point in the history
  • Loading branch information
foxnne committed Jan 30, 2025
1 parent 6063e54 commit a26a3da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/App.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const std = @import("std");
const builtin = @import("builtin");

const mach = @import("mach");
const gpu = mach.gpu;
Expand Down Expand Up @@ -88,7 +89,7 @@ pub fn init(
pixi.core.on_tick = app_mod.id.tick;
pixi.core.on_exit = app_mod.id.deinit;

const allocator = gpa.allocator();
const allocator = if (builtin.mode == .Debug) gpa.allocator() else std.heap.c_allocator;

// Run from the directory where the executable is located so relative assets can be found.
var buffer: [1024]u8 = undefined;
Expand Down

0 comments on commit a26a3da

Please sign in to comment.