| ... | @@ -4628,9 +4628,7 @@ pub const MProtectError = error{ | ... | @@ -4628,9 +4628,7 @@ pub const MProtectError = error{ |
| 4628 | OutOfMemory, | 4628 | OutOfMemory, |
| 4629 | } || UnexpectedError; | 4629 | } || UnexpectedError; |
| 4630 | | 4630 | |
| 4631 | /// `memory.len` must be page-aligned. | | |
| 4632 | pub fn mprotect(memory: []align(mem.page_size) u8, protection: u32) MProtectError!void { | 4631 | pub fn mprotect(memory: []align(mem.page_size) u8, protection: u32) MProtectError!void { |
| 4633 | assert(mem.isAligned(memory.len, mem.page_size)); | | |
| 4634 | if (native_os == .windows) { | 4632 | if (native_os == .windows) { |
| 4635 | const win_prot: windows.DWORD = switch (@as(u3, @truncate(protection))) { | 4633 | const win_prot: windows.DWORD = switch (@as(u3, @truncate(protection))) { |
| 4636 | 0b000 => windows.PAGE_NOACCESS, | 4634 | 0b000 => windows.PAGE_NOACCESS, |