Macros | |
#define | __C4D_MEM_ALIGNMENT_MASK__ |
#define | FillMemType(t, d, x, v) |
Functions | |
UInt | GeMemGetFreePhysicalMemoryEstimate () |
void | ClearMem (void *d, Int size, Int32 value=0) |
void | CopyMem (const void *s, void *d, Int size) |
void | MemCopy (void *d, const void *s, Int size) |
template<class T , class U > | |
void | FillMemTypeTemplate (T *data_ptr, Int size, const U *check_type, Int32 value) |
template<typename T > | |
void | ClearMemType (T *data_ptr, Int cnt) |
template<typename T > | |
void | CopyMemType (const T *src_ptr, T *dst_ptr, Int cnt) |
#define __C4D_MEM_ALIGNMENT_MASK__ |
Memory returned by NewMem() is guaranteed to be at least aligned to a 16 byte boundary.
Fills a block of memory of the specified type.
[in] | t | Data type (e.g. Char, Float). |
[out] | d | Address of 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. |
UInt GeMemGetFreePhysicalMemoryEstimate | ( | ) |
Gets estimated free physical memory.
Clears a block of memory.
[in] | d | Address of the memory block 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. Default to 0. |
void CopyMem | ( | const void * | s, |
void * | d, | ||
Int | size | ||
) |
Copies a block of memory.
memcpy()
[in] | s | Address of the source block of memory. The caller owns the pointed memory. |
[out] | d | Address of the destination block of memory. The caller owns the pointed memory. |
[in] | size | Size in bytes of the block of memory to copy. |
void MemCopy | ( | void * | d, |
const void * | s, | ||
Int | size | ||
) |
Copies a block of memory.
[out] | d | Address of the destination block of memory. The caller owns the pointed memory. |
[in] | s | Address of the source block of memory. The caller owns the pointed memory. |
[in] | size | Size in bytes of the block of memory to copy. |
void ClearMemType | ( | T * | data_ptr, |
Int | cnt | ||
) |
Clears a block of memory.
THREADSAFE.
[out] | data_ptr | Address of the block of memory to clear. The caller owns the pointed memory. |
[in] | cnt | Number of elements to be filled with pattern (> 1 e.g. for arrays), can be 0. |
void CopyMemType | ( | const T * | src_ptr, |
T * | dst_ptr, | ||
Int | cnt | ||
) |
Copies a block of memory to another of the same kind.
THREADSAFE
[in] | src_ptr | Address of the source block of memory to copy. The caller owns the pointed memory. |
[out] | dst_ptr | Address of the destination block of memory to copy to. The caller owns the pointed memory. |
[in] | cnt | Number of elements to be copied (> 1 e.g. for arrays), can be 0. |