mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
std.heap.page_size_min: relax freestanding restriction
x86_64 and aarch64 have safe values for page_size_min
This commit is contained in:
parent
faf256e429
commit
2447b87d98
@ -42,10 +42,8 @@ pub var next_mmap_addr_hint: ?[*]align(page_size_min) u8 = null;
|
||||
///
|
||||
/// On many systems, the actual page size can only be determined at runtime
|
||||
/// with `pageSize`.
|
||||
pub const page_size_min: usize = std.options.page_size_min orelse (page_size_min_default orelse if (builtin.os.tag == .freestanding or builtin.os.tag == .other)
|
||||
@compileError("freestanding/other page_size_min must provided with std.options.page_size_min")
|
||||
else
|
||||
@compileError(@tagName(builtin.cpu.arch) ++ "-" ++ @tagName(builtin.os.tag) ++ " has unknown page_size_min; populate std.options.page_size_min"));
|
||||
pub const page_size_min: usize = std.options.page_size_min orelse page_size_min_default orelse
|
||||
@compileError(@tagName(builtin.cpu.arch) ++ "-" ++ @tagName(builtin.os.tag) ++ " has unknown page_size_min; populate std.options.page_size_min");
|
||||
|
||||
/// comptime-known maximum page size of the target.
|
||||
///
|
||||
@ -831,8 +829,10 @@ const page_size_min_default: ?usize = switch (builtin.os.tag) {
|
||||
.xtensa => 4 << 10,
|
||||
else => null,
|
||||
},
|
||||
.freestanding => switch (builtin.cpu.arch) {
|
||||
.freestanding, .other => switch (builtin.cpu.arch) {
|
||||
.wasm32, .wasm64 => 64 << 10,
|
||||
.x86, .x86_64 => 4 << 10,
|
||||
.aarch64, .aarch64_be => 4 << 10,
|
||||
else => null,
|
||||
},
|
||||
else => null,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user