mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
remove length assertion from mprotect
This commit is contained in:
parent
c34cfe486d
commit
a76e98e7d5
1 changed files with 0 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue