| ... | ... | @@ -99,7 +99,11 @@ const math = std.math; |
| 99 | 99 | const assert = std.debug.assert; |
| 100 | 100 | const mem = std.mem; |
| 101 | 101 | const Allocator = std.mem.Allocator; |
| 102 | | const page_size = std.heap.pageSize(); // TODO: allow this to be runtime known |
| 102 | const page_size: usize = @max(std.heap.page_size_max, switch (builtin.os.tag) { |
| 103 | .windows => 64 * 1024, // Makes `std.heap.PageAllocator` take the happy path. |
| 104 | .wasi => 64 * 1024, // Max alignment supported by `std.heap.WasmAllocator`. |
| 105 | else => 2 * 1024 * 1024, // Avoids too many active mappings when `page_size_max` is low. |
| 106 | }); |
| 103 | 107 | const StackTrace = std.builtin.StackTrace; |
| 104 | 108 | |
| 105 | 109 | /// Integer type for pointing to slots in a small allocation |