System memory wrapper.
More...
#include <Memory.hpp>
◆ AlignSize()
Align size to specified alignment.
- Parameters
-
| size | Size in bytes to align |
| alignment | Alignment in bytes (must be power of 2) |
- Returns
- Aligned size
◆ Allocate()
| static void* Memory::Allocate |
( |
size_t |
sizeInBytes | ) |
|
|
inlinestatic |
Dynamically allocates data by default system allocator.
- Parameters
-
| sizeInBytes | Non-zero size in byte to allocate |
- Returns
- Pointer to allocated memory
◆ Compare()
| static int Memory::Compare |
( |
const void * |
a, |
|
|
const void * |
b, |
|
|
size_t |
sizeInBytes |
|
) |
| |
|
inlinestatic |
Compare two raw buffers
- Parameters
-
| a | Input buffer |
| b | Input buffer |
| sizeInBytes | Range to compare |
- Returns
- 0 if equals
◆ Copy()
| static void Memory::Copy |
( |
void * |
destination, |
|
|
const void * |
source, |
|
|
size_t |
sizeInBytes |
|
) |
| |
|
inlinestatic |
Copy source to the destination region.
- Note
- If sizeInBytes == 0 function does nothing.
- Parameters
-
| destination | Where to copy data |
| source | Data to copy |
| sizeInBytes | Size of the source region to copy (in bytes) |
◆ Deallocate()
| static void Memory::Deallocate |
( |
void * |
memory | ) |
|
|
inlinestatic |
◆ GetAllocateCalls()
| static size_t Memory::GetAllocateCalls |
( |
| ) |
|
|
inlinestatic |
- Returns
- Total number of allocate calls
◆ GetDeallocateCalls()
| static size_t Memory::GetDeallocateCalls |
( |
| ) |
|
|
inlinestatic |
- Returns
- Total number of deallocate calls
◆ Reallocate()
| static void* Memory::Reallocate |
( |
void * |
memory, |
|
|
size_t |
sizeInBytes |
|
) |
| |
|
inlinestatic |
Reallocates previously allocated memory with Allocate() or Reallocate() functions.
- Parameters
-
| memory | Pointer to memory to reallocate |
| sizeInBytes | Non-zero size in byte to reallocate |
- Returns
◆ Set()
| static void Memory::Set |
( |
void * |
destination, |
|
|
int |
value, |
|
|
size_t |
sizeInBytes |
|
) |
| |
|
inlinestatic |
Set destination bytes to value.
- Note
- If sizeInBytes == 0 function does nothing.
- Parameters
-
| destination | Where to set data |
| value | Byte to set |
| sizeInBytes | Size of the destination region to set (in bytes) |
◆ ALIGNMENT
| const size_t Memory::ALIGNMENT = 16 |
|
static |
◆ KiB
| const size_t Memory::KiB = 1024 |
|
static |
◆ MiB
The documentation for this class was generated from the following file: