diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-10 21:51:57 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-10 21:51:57 +0300 |
| commit | 425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch) | |
| tree | e52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/src/lib/allocator.zig | |
| parent | 90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff) | |
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/lib/allocator.zig')
| -rw-r--r-- | vendor/libghostty-vt/src/lib/allocator.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/libghostty-vt/src/lib/allocator.zig b/vendor/libghostty-vt/src/lib/allocator.zig index fc56033a..de343dab 100644 --- a/vendor/libghostty-vt/src/lib/allocator.zig +++ b/vendor/libghostty-vt/src/lib/allocator.zig @@ -2,8 +2,8 @@ const std = @import("std"); const builtin = @import("builtin"); const testing = std.testing; -/// Convenience functions -pub const convenience = @import("allocator/convenience.zig"); +/// Wasm-specific allocation helpers. +pub const wasm = @import("allocator/wasm.zig"); /// Useful alias since they're required to create Zig allocators pub const ZigVTable = std.mem.Allocator.VTable; @@ -34,6 +34,10 @@ pub fn default(c_alloc_: ?*const Allocator) std.mem.Allocator { // Wasm if (comptime builtin.target.cpu.arch.isWasm()) return std.heap.wasm_allocator; + // Freestanding targets don't have a default heap. Using the failing + // allocator makes a missing allocator show up as out-of-memory. + if (comptime builtin.os.tag == .freestanding) return std.mem.Allocator.failing; + // No libc, use the preferred allocator for releases which is the // Zig SMP allocator. return std.heap.smp_allocator; |
