Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ pub fn build(b: *std.Build) void {
.use_llvm = use_llvm,
.use_lld = use_llvm,
});
if (optimize != .Debug) {
translate_c_exe.linkLibC();
}

b.installDirectory(.{
.source_dir = aro.path("include"),
Expand Down
11 changes: 8 additions & 3 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ const Translator = @import("Translator.zig");

const fast_exit = @import("builtin").mode != .Debug;

var general_purpose_allocator: std.heap.GeneralPurposeAllocator(.{}) = .init;
var debug_allocator: std.heap.DebugAllocator(.{}) = .init;

pub fn main() u8 {
const gpa = general_purpose_allocator.allocator();
defer _ = general_purpose_allocator.deinit();
const gpa = if (@import("builtin").link_libc)
std.heap.raw_c_allocator
else
debug_allocator.allocator();
defer if (!@import("builtin").link_libc) {
_ = debug_allocator.deinit();
};

var arena_instance = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena_instance.deinit();
Expand Down