Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::Memory Struct Reference

Centralized functions to allocate, reallocate and deallocate memory. More...

#include <Memory.h>

Static Public Member Functions

static SC_COMPILER_EXPORT void * allocate (size_t numBytes)
 Allocates numBytes bytes of memory. More...
 
static SC_COMPILER_EXPORT void * reallocate (void *allocatedMemory, size_t numBytes)
 Change size of already allocated memory block. More...
 
static SC_COMPILER_EXPORT void release (void *allocatedMemory)
 Free memory allocated by Memory::allocate and / or reallocated by Memory::reallocate. More...
 

Detailed Description

Centralized functions to allocate, reallocate and deallocate memory.

Member Function Documentation

◆ allocate()

static SC_COMPILER_EXPORT void * SC::Memory::allocate ( size_t  numBytes)
static

Allocates numBytes bytes of memory.

Parameters
numBytesNumber of bytes to allocate
Returns
Raw pointer to allocated memory, to be freed with Memory::release

◆ reallocate()

static SC_COMPILER_EXPORT void * SC::Memory::reallocate ( void *  allocatedMemory,
size_t  numBytes 
)
static

Change size of already allocated memory block.

Existing contents of input buffer will be copied over.

Parameters
allocatedMemorypointer to memory previously allocated by Memory::allocate or Memory::Reallocate
numBytesnew size of the reallocated blck
Returns
A new pointer of memory with size numBytes, to be freed with Memory::release

◆ release()

static SC_COMPILER_EXPORT void SC::Memory::release ( void *  allocatedMemory)
static

Free memory allocated by Memory::allocate and / or reallocated by Memory::reallocate.

Parameters
allocatedMemoryMemory to release / deallocate

The documentation for this struct was generated from the following file: