78__forceinline
unsigned char*
81 unsigned char paddingMask = size_t(ptr) & 15;
82 ptr = (
unsigned char*)(
size_t(ptr + 16) & ~15);
83 ptr[-1] = paddingMask;
92__forceinline
unsigned char*
95 return (
unsigned char*)(size_t(ptr - 16) | ptr[-1]);
107 unsigned char* ptr = (
unsigned char*) ::HeapAlloc(hHeap, dwFlags, dwBytes + 16);
122 unsigned char* ptr = (
unsigned char*) lpMem;
128 ptr = (
unsigned char*) ::HeapReAlloc(hHeap, (dwFlags | HEAP_REALLOC_IN_PLACE_ONLY), rawPtr, dwBytes + 16);
131 SIZE_T rawSize = ::HeapSize(hHeap, dwFlags, rawPtr);
133 ptr = (
unsigned char*) ::HeapAlloc(hHeap, dwFlags, dwBytes + 16);
135 SIZE_T copySize = dwBytes <= (rawSize - 16) ? dwBytes : (rawSize - 16);
136 ::CopyMemory(ptr, lpMem, copySize);
138 ::HeapFree(hHeap, dwFlags, rawPtr);
157 unsigned char* ptr = (
unsigned char*) lpMem;
159 return ::HeapFree(hHeap, dwFlags, ptr);
169 unsigned char* ptr = (
unsigned char*) lpMem;
171 return ::HeapSize(hHeap, dwFlags, ptr);
Nebula compiler specific defines and configuration.
Definition arenaallocator.h:31
__forceinline unsigned char * __HeapUnalignPointer16(unsigned char *ptr)
Helper function for Heap16 functions: "un-aligns" pointer through the padding mask stored in the byte...
Definition win32memoryconfig.h:93
const char * GetHeapTypeName(HeapType heapType)
Returns a human readable name for a heap type.
Definition osxmemoryconfig.cc:52
__forceinline unsigned char * __HeapAlignPointerAndWritePadding16(unsigned char *ptr)
Global PoolArrayAllocator objects, these are all setup in a central place in the Memory::SetupHeaps()...
Definition win32memoryconfig.h:79
HeapType
Heap types are defined here.
Definition osxmemoryconfig.h:25
@ NumHeapTypes
Definition osxmemoryconfig.h:36
@ StreamDataHeap
Definition osxmemoryconfig.h:32
@ AppHeap
Definition osxmemoryconfig.h:34
@ ResourceHeap
Definition osxmemoryconfig.h:29
@ DefaultHeap
Definition osxmemoryconfig.h:26
@ ScriptingHeap
Definition posixmemoryconfig.h:38
@ ObjectHeap
Definition osxmemoryconfig.h:27
@ InvalidHeapType
Definition osxmemoryconfig.h:37
@ PhysicsHeap
Definition osxmemoryconfig.h:33
@ NetworkHeap
Definition posixmemoryconfig.h:37
@ ObjectArrayHeap
Definition osxmemoryconfig.h:28
@ ScratchHeap
Definition osxmemoryconfig.h:30
@ StringDataHeap
Definition osxmemoryconfig.h:31
__forceinline SIZE_T __HeapSize16(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem)
HeapSize replacement function.
Definition win32memoryconfig.h:167
__forceinline LPVOID __HeapReAlloc16(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes)
HeapReAlloc replacement for 16-byte alignment.
Definition win32memoryconfig.h:119
__forceinline LPVOID __HeapAlloc16(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes)
HeapAlloc replacement which always returns 16-byte aligned addresses.
Definition win32memoryconfig.h:105
void SetupHeaps()
Setup the global heaps.
Definition osxmemoryconfig.cc:19
__forceinline BOOL __HeapFree16(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem)
HeapFree replacement which always returns 16-byte aligned addresses.
Definition win32memoryconfig.h:155
malloc_zone_t * Heaps[NumHeapTypes]
Heap pointers are defined here.
Definition osxmemoryconfig.cc:12