XMemCreateWin32Heap
Creates a Win32 heap.Syntax
Parameters
HeapFlags _In_Type: ULONGLONG Indicates the source of memory for the heap to be created.
baseAddress _In_
Type: PVOID The base address for the in-place heap allocation. If
HeapFlags is set to XMEM_HEAP_INPLACE, this value must point to an address in committed memory that is aligned to a 4-KB boundary; otherwise, this value must be set to NULL.
Return value
Type: HANDLE Returns a handle to the created Win32 heap, if successful; otherwise, returnsNULL. If it’s available, extended error information is provided to the current XErrorCallback callback for your app.
Remarks
This function creates a Win32 heap, allocating memory for the heap from the source and base address indicated byHeapFlags and baseAddress, respectively. If XMEM_HEAP_INPLACE was not specified in HeapFlags when the heap was created, the heap is backed by either 2MB pages (or 64KB pages if XMEM_HEAP_64K_PAGES is specified). If an error occurs while attempting to create a Win32 heap, this method returns NULL and, if available, the error is reported to the current XErrorCallback callback for your app. For more information about handling exceptional error cases, see XError.
For more information about configuring and accessing memory, see Configuring memory for your title and dev kit.
Allocating tooling memory
IfXMEM_HEAP_TOOL is specified in HeapFlags, the function attempts to allocate memory from the tools partition to create the Win32 heap, depending on Profiling Mode and Iteration Mode settings:
- If Iteration Mode is disabled and Profiling Mode is enabled, the function attempts to allocate the requested amount of memory from the tools partition. If the requested amount is unavailable, an error occurs.
- If Iteration Mode is disabled and Profiling Mode is disabled, an error occurs.
- If Iteration Mode is enabled, the function attempts to allocate the requested amount of memory from the title partition. If the requested amount is unavailable, an error occurs.
Requirements
Header: xmem.h Library: xmem.lib Supported platforms: XBOX One family consoles and XBOX Series consolesSee also
MemoryXMem
