Macros | |
#define | NewMemClear(t, x) |
#define | NewMem(t, x) |
#define | ReallocMemType(t, p, s) |
#define | DeleteMem(x) |
#define | ClearMemType(t, d, x) |
#define | FillMemType(t, d, x, v) |
#define | CopyMemType(t, s, d, x) |
Functions | |
void * | MemAllocNC (Int size) |
void * | MemAlloc (Int size) |
void * | MemRealloc (void *orimem, Int size) |
void | MemFree (void *&mem) |
void | _MemFree (void **mem) |
void | CopyMem (const void *s, void *d, Int size) |
void | ClearMem (void *d, Int size, Int32 value=0) |
Int | CompareMem (const void *s, const void *d, Int size) |
template<class T , class U > | |
void | ClearMemTypeTemplate (T *data_ptr, Int size, const U *check_type) |
template<class T , class U > | |
void | FillMemTypeTemplate (T *data_ptr, Int size, const U *check_type, Int32 value) |
template<class T , class U > | |
void | CopyMemTypeTemplate (const T *src_ptr, T *dst_ptr, Int size, const U *check_type) |
#define NewMemClear | ( | t, | |
x | |||
) |
Allocates raw memory and clear it.
[in] | t | Type of item (e.g. Char, Float). |
[in] | x | Number of items. THREADSAFE. |
#define NewMem | ( | t, | |
x | |||
) |
Allocates raw memory.
[in] | t | Type of item (e.g. Char, Float). |
[in] | x | Number of items. THREADSAFE. |
#define ReallocMemType | ( | t, | |
p, | |||
s | |||
) |
Resizes raw memory.
[in] | t | Type of item (e.g. Char, Float). |
[in] | p | Pointer to the previous memory block. Can be nullptr. The caller owns the pointed memory. |
[in] | s | New number of items. New size of the memory block is s * sizeof(t)) THREADSAFE. |
#define DeleteMem | ( | x | ) |
Frees raw memory block.
#define ClearMemType | ( | t, | |
d, | |||
x | |||
) |
Clears a block of memory of the specified type.
[in] | t | Data type (e.g. Char, Float). |
[in] | d | Pointer to the block of memory to clear. The caller owns the pointed memory. |
[in] | x | Size of the memory block to clear. |
#define FillMemType | ( | t, | |
d, | |||
x, | |||
v | |||
) |
Fills a block of memory of the specified type.
[in] | t | Data type (e.g. Char, Float). |
[in] | d | Pointer to the block of memory to fill. The caller owns the pointed memory. |
[in] | x | Size of the memory block to fill. |
[in] | v | Value to fill the memory block with. |
#define CopyMemType | ( | t, | |
s, | |||
d, | |||
x | |||
) |
Copies a block of memory of the specified type.
[in] | t | Data type (e.g. Char, Float). |
[in] | s | Pointer to the source block of memory. The caller owns the pointed memory. |
[in] | d | Pointer to the destination block of memory. The caller owns the pointed memory. |
[in] | x | Number of elements to copy. |
void * MemAllocNC | ( | Int | size | ) |
Internal.
Memory allocation functions. Overload MemAlloc() / MemFree() for custom memory management.
void * MemAlloc | ( | Int | size | ) |
Internal.
void * MemRealloc | ( | void * | orimem, |
Int | size | ||
) |
Internal.
void MemFree | ( | void *& | mem | ) |
Internal.
void cineware::_MemFree | ( | void ** | mem | ) |
Internal.
void cineware::CopyMem | ( | const void * | s, |
void * | d, | ||
Int | size | ||
) |
Copies a block of memory.
[in] | s | Pointer to the source block of memory. The caller owns the pointed memory. |
[in] | d | Pointer to the destination block of memory. The caller owns the pointed memory. |
[in] | size | Size in bytes of the block of memory to copy. |
Clears a block of memory.
[in] | d | Pointer to the block of memory to clear. The caller owns the pointed memory. |
[in] | size | Size in bytes of the block of memory to clear. |
[in] | value | Value to clear the memory block with. |
Compares two blocks of memory.
[in] | s | First block of memory. The caller owns the pointed memory. |
[in] | d | Second block of memory. The caller owns the pointed memory. |
[in] | size | Number of bytes to compare. |
memcmp()
. void cineware::ClearMemTypeTemplate | ( | T * | data_ptr, |
Int | size, | ||
const U * | check_type | ||
) |
Internal.
Internal.
void cineware::CopyMemTypeTemplate | ( | const T * | src_ptr, |
T * | dst_ptr, | ||
Int | size, | ||
const U * | check_type | ||
) |
Internal.