User defined wrappers for the OS memory API.
◆ GTS_ENABLE_LARGE_PAGE_SUPPORT
#define GTS_ENABLE_LARGE_PAGE_SUPPORT |
( |
| ) |
#error "Replace with custom definition" |
- Returns
- True if large pages are enabled.
◆ GTS_GET_OS_ALLOCATION_GRULARITY
#define GTS_GET_OS_ALLOCATION_GRULARITY |
( |
| ) |
#error "Replace with custom definition" |
- Returns
- The allocation granularity for GTS_OS_VIRTUAL_ALLOCATE.
◆ GTS_GET_OS_LARGE_PAGE_SIZE
#define GTS_GET_OS_LARGE_PAGE_SIZE |
( |
| ) |
#error "Replace with custom definition" |
- Returns
- The allocation granularity for Large Pages. Zero if large pages are not supported.
◆ GTS_GET_OS_PAGE_SIZE
#define GTS_GET_OS_PAGE_SIZE |
( |
| ) |
#error "Replace with custom definition" |
- Returns
- The commit granularity for GTS_OS_VIRTUAL_COMMIT.
◆ GTS_OS_HEAP_ALLOCATE
#define GTS_OS_HEAP_ALLOCATE |
( |
|
size | ) |
#error "Replace with custom definition" |
Allocates a block of memory from the OS Heap. (i.e. HeapAlloc on Win32)
Deallocate a block of memory to the OS Heap. (i.e. HeapFree on Win32)
- Parameters
-
size | The size of the memory to allocate. |
- Returns
- A pointer to the memory or nullptr on fail.
- Parameters
-
ptr | A pointer to the memory to free that was allocated with GTS_OS_HEAP_ALLOCATE. |
◆ GTS_OS_VIRTUAL_ALLOCATE
#define GTS_OS_VIRTUAL_ALLOCATE |
( |
|
ptr, |
|
|
|
size, |
|
|
|
commit, |
|
|
|
largePage |
|
) |
| #error "Replace with custom definition" |
Creates a new mapping in the virtual address space of the calling process.
- Parameters
-
size | The size of the memory to reserve or commit. Must be a multiple of GTS_GET_OS_ALLOCATION_GRULARITY. |
commit | True to reserve and commit the memory. |
largePage | True to use Large Pages. Large pages always commit. |
- Returns
- A valid pointer, UINTPTR_MAX if out of memory, or nullptr for other errors.
◆ GTS_OS_VIRTUAL_COMMIT
#define GTS_OS_VIRTUAL_COMMIT |
( |
|
ptr, |
|
|
|
size |
|
) |
| #error "Replace with custom definition" |
Creates a mapping from a range of virtual address space to physical address space.
- Parameters
-
size | The size of the address range. Must be a multiple of GTS_GET_OS_PAGE_SIZE. |
- Returns
- A to the committed memory or nullptr on fail.
◆ GTS_OS_VIRTUAL_DECOMMIT
#define GTS_OS_VIRTUAL_DECOMMIT |
( |
|
ptr, |
|
|
|
size |
|
) |
| #error "Replace with custom definition" |
Unmaps a range of physical address space.
Unmaps a range of virtual address space, decommitting any committed page.
- Parameters
-
size | The size of the address range. Must be a multiple of GTS_GET_OS_PAGE_SIZE. |
- Returns
- True on success, false on fail.
- Parameters
-
size | The size of the address range. Must be a multiple of GTS_GET_OS_PAGE_SIZE. |
- Returns
- True on success, false on fail.