Skip to content

Commit

Permalink
♻️ Use arena allocator instead of gpa
Browse files Browse the repository at this point in the history
  • Loading branch information
segersniels committed Mar 30, 2024
1 parent 43e40e4 commit 9892655
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/cli/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const openai = @import("openai.zig");
const git = @import("git.zig");
const cli = @import("zig-cli");

var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = gpa.allocator();
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
const allocator = arena.allocator();

var config = struct {
model: []const u8 = "gpt-4-turbo-preview",
Expand Down Expand Up @@ -41,5 +41,7 @@ var app = &cli.App{
};

pub fn main() !void {
defer arena.deinit();

return cli.run(app, allocator);
}

0 comments on commit 9892655

Please sign in to comment.