c4d_memory.h File Reference

Macros

#define  __C4D_MEM_ALIGNMENT_MASK__
#define  FillMemType (t, d, x, v)

函数

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)

Macro Definition Documentation

◆  __C4D_MEM_ALIGNMENT_MASK__

#define __C4D_MEM_ALIGNMENT_MASK__

Memory returned by NewMem() is guaranteed to be at least aligned to a 16 byte boundary.

◆  FillMemType

#define FillMemType (   t,
  d,
  x,
 
)

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.

Function Documentation

◆  GeMemGetFreePhysicalMemoryEstimate()

UInt GeMemGetFreePhysicalMemoryEstimate ( )

Gets estimated free physical memory.

返回
Estimated free physical memory.

◆  ClearMem()

void ClearMem ( void *  d ,
Int   size ,
Int32   value = 0  
)

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 .

◆  CopyMem()

void CopyMem ( const void *  s ,
void *  d ,
Int   size  
)

Copies a block of memory.

警告
Parameters order is the opposite of memcpy()
另请参阅
MemCopy()
参数
[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.

◆  MemCopy()

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.

◆  FillMemTypeTemplate()

void FillMemTypeTemplate ( T *  data_ptr ,
Int   size ,
const U *  check_type ,
Int32   value  
)

Internal .

◆  ClearMemType()

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 .

◆  CopyMemType()

void CopyMemType ( const T *  src_ptr ,
T *  dst_ptr ,
Int   cnt  
)

Copies a block of memory to another of the same kind.
THREADSAFE

警告
Source and destination must not overlap.
参数
[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 .