Centralized functions to allocate, reallocate and deallocate memory.
More...
#include <Memory.h>
|
| static void * | allocate (size_t numBytes, size_t alignment) |
| | Allocates numBytes bytes of memory.
|
| |
| static void * | reallocate (void *memory, size_t numBytes) |
| | Change size of already allocated memory block.
|
| |
| static void | release (void *memory) |
| | Free memory allocated by Memory::allocate and / or reallocated by Memory::reallocate.
|
| |
| static void | move (void *dst, const void *src, size_t numBytes) |
| | Move numBytes bytes of memory from src to dst. The memory areas may overlap.
|
| |
| static void | set (void *dst, int c, size_t numBytes) |
| | Set numBytes bytes of memory at dst to the value c.
|
| |
| static void | copy (void *dst, const void *src, size_t numBytes) |
| | Copy numBytes bytes of memory from src to dst. The memory areas must not overlap.
|
| |
Centralized functions to allocate, reallocate and deallocate memory.
◆ allocate()
| static void * SC::Memory::allocate |
( |
size_t | numBytes, |
|
|
size_t | alignment ) |
|
static |
Allocates numBytes bytes of memory.
- Parameters
-
| numBytes | Number of bytes to allocate |
| alignment | Alignment of the returned memory |
- Returns
- Raw pointer to allocated memory, to be freed with Memory::release
◆ copy()
| static void SC::Memory::copy |
( |
void * | dst, |
|
|
const void * | src, |
|
|
size_t | numBytes ) |
|
static |
Copy numBytes bytes of memory from src to dst. The memory areas must not overlap.
◆ move()
| static void SC::Memory::move |
( |
void * | dst, |
|
|
const void * | src, |
|
|
size_t | numBytes ) |
|
static |
Move numBytes bytes of memory from src to dst. The memory areas may overlap.
◆ reallocate()
| static void * SC::Memory::reallocate |
( |
void * | memory, |
|
|
size_t | numBytes ) |
|
static |
Change size of already allocated memory block.
Existing contents of input buffer will be copied over.
- Parameters
-
| memory | pointer to memory previously allocated by Memory::allocate or Memory::Reallocate |
| numBytes | new size of the reallocated block |
- Returns
- A new pointer of memory with size numBytes, to be freed with Memory::release
◆ release()
| static void SC::Memory::release |
( |
void * | memory | ) |
|
|
static |
◆ set()
| static void SC::Memory::set |
( |
void * | dst, |
|
|
int | c, |
|
|
size_t | numBytes ) |
|
static |
Set numBytes bytes of memory at dst to the value c.
The documentation for this struct was generated from the following file: