Method
lock_memory
(self, addr:int, size:int)
Source from the content-addressed store, hash-verified
| 46 | def memory_barrier(self): lib.atomic_thread_fence(__ATOMIC_SEQ_CST:=5) if (lib:=self.libsys if OSX else self.atomic_lib) is not None else None |
| 47 | |
| 48 | def lock_memory(self, addr:int, size:int): |
| 49 | if libc.mlock(ctypes.c_void_p(addr), size): raise RuntimeError(f"Failed to lock memory at {addr:#x} with size {size:#x}") |
| 50 | |
| 51 | def system_paddrs(self, vaddr:int, size:int) -> list[int]: |
| 52 | self.pagemap.seek(vaddr // mmap.PAGESIZE * 8) |
Tested by
no test coverage detected