Module jit_allocator::virtual_memory
source · Structs
- Dual memory mapping used to map an anonymous memory into two memory regions where one region is read-only, but executable, and the second region is read+write, but not executable. See alloc_dual_mapping for more details.
- Virtual memory information.
Enums
- Hardened runtime flags.
- Values that can be used with
protect_jit_memory
function.
Constants
Functions
- Allocates virtual memory and creates two views of it where the first view has no write access. This is an addition to the API that should be used in cases in which the operating system either enforces W^X security policy or the application wants to use this policy by default to improve security and prevent an accidental (or purposed) self-modifying code.
- Flushes instruction cache in the given region.
- Detects whether the current process is hardened, which means that pages that have WRITE and EXECUTABLE flags cannot be normally allocated. On OSX + AArch64 such allocation requires MAP_JIT flag, other platforms don’t support this combination.
- Protects access of memory mapped with MAP_JIT flag for the current thread.
- Releases virtual memory mapping previously allocated by alloc_dual_mapping().