defaultallocator.h File Reference

Classes

class   DefaultAllocator
struct   IsZeroInitialized< DefaultAllocator >

Namespaces

  maxon

Macros

#define  NewMem (T, cnt)
#define  NewMemClear (T, cnt)
#define  ReallocMem (p, cnt)

函数

template<typename T >
MAXON_ATTRIBUTE_FORCE_INLINE ResultPtr< T >  _ReallocMem (T *p, Int cnt, MAXON_SOURCE_LOCATION_DECLARATION )
template<typename T >
void  DeleteMem (T *&p)
void  DeleteConstPtrMem (const void *p)
MAXON_ATTRIBUTE_FORCE_INLINE void  MemCopy (void *dst, const void *src, Int size)
MAXON_ATTRIBUTE_FORCE_INLINE void  MemMove (void *dst, const void *src, Int size)
template<typename T >
MAXON_ATTRIBUTE_FORCE_INLINE void  MemCopyType (T *dst, const T *src, Int cnt)
template<typename T >
MAXON_ATTRIBUTE_FORCE_INLINE void  MemMoveType (T *dst, const T *src, Int cnt)
MAXON_ATTRIBUTE_FORCE_INLINE void  ClearMem (void *mem, Int size, UChar value=0)
MAXON_ATTRIBUTE_FORCE_INLINE void  SecureClearMem (volatile void *mem, Int size, UChar value=0)
MAXON_ATTRIBUTE_FORCE_INLINE Int   CompareMem (const void *block1, const void *block2, Int size)
template<typename T >
MAXON_ATTRIBUTE_FORCE_INLINE void  ClearMemType (T *data_ptr, Int cnt, UChar value=0)

Macro Definition Documentation

◆  NewMem

#define NewMem (   T,
  cnt 
)

Allocates raw memory: no constructors are called! A valid memory address will be returned if cnt is 0 (unless there was not enough memory).

注意
This behaviour was different in Cinema 4D where nullptr was returned. THREADSAFE.
参数
[in] T Type of item (e.g. Char, Float)
[in] cnt Number of items.
返回
Pointer to memory block or nullptr.

◆  NewMemClear

#define NewMemClear (   T,
  cnt 
)

Allocates raw memory and clears it: no constructors are called! THREADSAFE.

参数
[in] T Type of item (e.g. Char, Float)
[in] cnt Number of items.
返回
Pointer to memory block or nullptr.

◆  ReallocMem

#define ReallocMem (   p,
  cnt 
)

Resizes a raw memory block : no constructors are called! The content of the memory block is preserved up to the lesser of the new and old sizes, even if the block is moved to a new location. The additional memory is not cleared, it may contain a certain byte pattern in debug mode. In case that p is a nullptr the function behaves like NewMem. If the function fails to allocate the requested block of memory a nullptr is returned and the memory block pointed to by argument p is not deallocated (it is still valid with its contents unchanged). THREADSAFE.

参数
[in] p Current memory block (can be nullptr)
[in] cnt New number of items (size of the memory block is n * sizeof(T))
返回
Memory block address or nullptr if resize is not possible (p is still valid in this case)