mirror of
https://github.com/ziex-dev/ziex.git
synced 2026-07-21 02:59:36 -06:00
fix: zon file too big
This commit is contained in:
parent
6e23df23c3
commit
46be5acac2
@ -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 {
|
||||
|
||||
@ -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();
|
||||
|
||||
13
src/main.zig
13
src/main.zig
@ -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 },
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user