Sane C++ Libraries
C++ Platform Abstraction Libraries
Memory.h
1// Copyright (c) Stefano Cristiano
2// SPDX-License-Identifier: MIT
3#pragma once
4#include "../Foundation/PrimitiveTypes.h"
5namespace SC
6{
7struct Memory;
8}
11
14{
18 SC_COMPILER_EXPORT static void* allocate(size_t numBytes);
19
24 SC_COMPILER_EXPORT static void* reallocate(void* allocatedMemory, size_t numBytes);
25
28 SC_COMPILER_EXPORT static void release(void* allocatedMemory);
29};
#define SC_COMPILER_EXPORT
Macro for symbol visibility in non-MSVC compilers.
Definition: Compiler.h:78
Centralized functions to allocate, reallocate and deallocate memory.
Definition: Memory.h:14
static SC_COMPILER_EXPORT void * allocate(size_t numBytes)
Allocates numBytes bytes of memory.
static SC_COMPILER_EXPORT void * reallocate(void *allocatedMemory, size_t numBytes)
Change size of already allocated memory block.
static SC_COMPILER_EXPORT void release(void *allocatedMemory)
Free memory allocated by Memory::allocate and / or reallocated by Memory::reallocate.