| ... | @@ -90,11 +90,16 @@ const mem = std.mem; | ... | @@ -90,11 +90,16 @@ const mem = std.mem; |
| 90 | const Allocator = std.mem.Allocator; | 90 | const Allocator = std.mem.Allocator; |
| 91 | const StackTrace = std.builtin.StackTrace; | 91 | const StackTrace = std.builtin.StackTrace; |
| 92 | | 92 | |
| 93 | const default_page_size: usize = @max(std.heap.page_size_max, switch (builtin.os.tag) { | 93 | const default_page_size: usize = switch (builtin.os.tag) { |
| 94 | .windows => 64 * 1024, // Makes `std.heap.PageAllocator` take the happy path. | 94 | // Makes `std.heap.PageAllocator` take the happy path. |
| 95 | .wasi => 64 * 1024, // Max alignment supported by `std.heap.WasmAllocator`. | 95 | .windows => 64 * 1024, |
| 96 | else => 128 * 1024, // Avoids too many active mappings when `page_size_max` is low. | 96 | else => switch (builtin.cpu.arch) { |
| 97 | }); | 97 | // Max alignment supported by `std.heap.WasmAllocator`. |
| | 98 | .wasm32, .wasm64 => 64 * 1024, |
| | 99 | // Avoids too many active mappings when `page_size_max` is low. |
| | 100 | else => @max(std.heap.page_size_max, 128 * 1024), |
| | 101 | }, |
| | 102 | }; |
| 98 | | 103 | |
| 99 | const Log2USize = std.math.Log2Int(usize); | 104 | const Log2USize = std.math.Log2Int(usize); |
| 100 | | 105 | |