fix: zon file too big

This commit is contained in:
Nurul Huda (Apon) 2026-03-22 17:34:01 +06:00
parent 6e23df23c3
commit 46be5acac2
No known key found for this signature in database
GPG Key ID: 5D3F1DE2855A2F79
3 changed files with 13 additions and 11 deletions

View File

@ -47,7 +47,7 @@ pub fn inspectProgram(allocator: std.mem.Allocator, binpath: []const u8) !Serili
exe.stderr_behavior = .Ignore;
try exe.spawn();
const source = if (exe.stdout) |estdout| estdout.readToEndAlloc(allocator, 8192) catch |err| {
const source = if (exe.stdout) |estdout| estdout.readToEndAlloc(allocator, std.math.maxInt(usize)) catch |err| {
_ = exe.kill() catch {};
return err;
} else {

View File

@ -12,9 +12,12 @@ const sourcemap = zx.sourcemap;
var debug_allocator: std.heap.DebugAllocator(.{}) = .init;
pub fn main() !void {
const gpa, const is_debug = switch (builtin.mode) {
.Debug, .ReleaseSafe => .{ debug_allocator.allocator(), true },
.ReleaseFast, .ReleaseSmall => .{ std.heap.smp_allocator, false },
const gpa, const is_debug = switch (builtin.os.tag) {
.wasi, .freestanding => .{ std.heap.wasm_allocator, false },
else => switch (builtin.mode) {
.Debug, .ReleaseSafe => .{ debug_allocator.allocator(), true },
.ReleaseFast, .ReleaseSmall => .{ std.heap.smp_allocator, false },
},
};
defer if (is_debug) {
_ = debug_allocator.deinit();

View File

@ -1,9 +1,12 @@
pub fn main() !void {
var dbg = std.heap.DebugAllocator(.{}).init;
const allocator = switch (builtin.mode) {
.Debug => dbg.allocator(),
.ReleaseFast, .ReleaseSafe, .ReleaseSmall => std.heap.smp_allocator,
const allocator = switch (builtin.os.tag) {
.wasi, .freestanding => std.heap.wasm_allocator,
else => switch (builtin.mode) {
.Debug => dbg.allocator(),
.ReleaseFast, .ReleaseSafe, .ReleaseSmall => std.heap.smp_allocator,
},
};
defer if (builtin.mode == .Debug) std.debug.assert(dbg.deinit() == .ok);
@ -95,10 +98,6 @@ const lsp = @import("lsp/main.zig");
pub const std_options = std.Options{
.log_scope_levels = &[_]std.log.ScopeLevel{
.{ .scope = .@"html/ast", .level = .info },
.{ .scope = .@"html/tokenizer", .level = .info },
.{ .scope = .@"html/ast/fmt", .level = .info },
.{ .scope = .ast, .level = if (builtin.mode == .Debug) .info else .warn },
.{ .scope = .cli, .level = if (builtin.mode == .Debug) .info else .info },
},
};