mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 21:08:36 +00:00
remove length assertion from mprotect
This commit is contained in:
parent
c34cfe486d
commit
a76e98e7d5
@ -4628,9 +4628,7 @@ pub const MProtectError = error{
|
||||
OutOfMemory,
|
||||
} || UnexpectedError;
|
||||
|
||||
/// `memory.len` must be page-aligned.
|
||||
pub fn mprotect(memory: []align(mem.page_size) u8, protection: u32) MProtectError!void {
|
||||
assert(mem.isAligned(memory.len, mem.page_size));
|
||||
if (native_os == .windows) {
|
||||
const win_prot: windows.DWORD = switch (@as(u3, @truncate(protection))) {
|
||||
0b000 => windows.PAGE_NOACCESS,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user