Nebula
Loading...
Searching...
No Matches
win32memory.h File Reference

Detailed Description

Memory subsystem features for win32.

#include "core/config.h"
#include "core/debug.h"
#include "threading/interlocked.h"
#include "memory/win32/win32memoryconfig.h"
#include "memory/win32/winmemory.h"
#include <new>

Go to the source code of this file.

Classes

struct  Memory::TotalMemoryStatus
 Get the system's total current memory, this does not only include Nebula's memory allocations but the memory usage of the entire system. More...
 

Namespaces

namespace  Memory
 

Macros

#define StackAlloc(size)
 Allocate memory on the stack.
 
#define StackFree(ptr)
 
#define __MEMORY_CHECKPOINT(s)
 Debug function which validates the process heap.
 
#define __MEMORY_VALIDATE(s)
 

Functions

void * Memory::Alloc (HeapType heapType, size_t size, size_t alignment)
 Allocate a block of memory from one of the global heaps.
 
void * Memory::Realloc (HeapType heapType, void *ptr, size_t size)
 Re-Allocate a block of memory from one of the global heaps.
 
void Memory::Free (HeapType heapType, void *ptr)
 Free a block of memory.
 
__forceinline void * Memory::AllocVirtual (size_t size)
 allocate a range of virtual memory space
 
__forceinline void Memory::CommitVirtual (void *ptr, size_t size)
 commit virtual memory
 
__forceinline void Memory::DecommitVirtual (void *ptr, size_t size)
 decommit virtual memory
 
__forceinline void Memory::FreeVirtual (void *ptr, size_t size)
 free virtual memory
 
char * Memory::DuplicateCString (const char *from)
 Duplicate a 0-terminated string, this method should no longer be used!
 
bool Memory::IsOverlapping (const unsigned char *srcPtr, size_t srcSize, const unsigned char *dstPtr, size_t dstSize)
 Test if 2 areas of memory areas are overlapping.
 
TotalMemoryStatus Memory::GetTotalMemoryStatus ()
 Get the system's total memory status.
 
void Memory::DumpTotalMemoryStatus ()
 Dump detail memory status information.
 

Macro Definition Documentation

◆ __MEMORY_CHECKPOINT

#define __MEMORY_CHECKPOINT ( s)

Debug function which validates the process heap.

This will NOT check local heaps (call Heap::ValidateAllHeaps() for this). Stops the program if something is wrong.

◆ __MEMORY_VALIDATE

#define __MEMORY_VALIDATE ( s)

◆ StackAlloc

#define StackAlloc ( size)
Value:
_malloca(size);

Allocate memory on the stack.

◆ StackFree

#define StackFree ( ptr)
Value:
_freea(ptr);