remove length assertion from mprotect

This commit is contained in:
Hila Friedman 2024-08-18 13:12:28 +03:00 committed by Andrew Kelley
parent c34cfe486d
commit a76e98e7d5

View File

@ -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,