Module alloc

Source
Expand description

Support for virtual memory management, including memory protections.

Structs§

MemoryError
An error which may result from a memory operation such as locking.
SecureAlloc
An allocator which obtains a discrete number of virtual memory pages.

Enums§

ProtectionMode
Enumeration of options for setting the memory protection mode.

Constants§

UNINIT_ALLOC_BYTE
Indicator value to help detect uninitialized protected data.

Functions§

alloc_pages
Allocate a page-aligned buffer. The alignment will be rounded up to a multiple of the platform pointer size if necessary.
dealloc_pages
Release a buffer allocated by alloc_aligned.
default_page_size
Fetch the system-specific page size.
lock_pages
Prevent swapping for the given memory range. On supported platforms, avoid including the memory in core dumps.
page_rounded_length
Round up a length of bytes to a multiple of the page size.
set_page_protection
Adjust the protection mode for a given memory range.
unlock_pages
Resume normal swapping behavior for the given memory range.