Open CASCADE Technology 7.8.2.dev
|
The package Standard provides global memory allocator and other basic services used by other OCCT components. More...
#include <Standard.hxx>
Public Types | |
enum class | AllocatorType { NATIVE = 0 , OPT = 1 , TBB = 2 , JEMALLOC = 3 } |
Enumiration of possible allocator types. More... | |
Static Public Member Functions | |
static AllocatorType | GetAllocatorType () |
Returns default allocator type. | |
static Standard_Address | Allocate (const Standard_Size theSize) |
Allocates memory blocks theSize - bytes to allocate. | |
static Standard_Address | AllocateOptimal (const Standard_Size theSize) |
Allocates memory blocks theSize - bytes to allocate. | |
static void | Free (const Standard_Address thePtr) |
Deallocates memory blocks. | |
template<typename T > | |
static void | Free (T *&thePtr) |
Template version of function Free(), nullifies the argument pointer. | |
static Standard_Address | Reallocate (const Standard_Address theStorage, const Standard_Size theNewSize) |
Reallocates memory blocks theStorage - previously allocated memory block theNewSize - new size in bytes. | |
static Standard_Address | AllocateAligned (const Standard_Size theSize, const Standard_Size theAlign) |
Allocates aligned memory blocks. Should be used with CPU instructions which require specific alignment. For example: SSE requires 16 bytes, AVX requires 32 bytes. | |
static void | FreeAligned (const Standard_Address thePtrAligned) |
Deallocates memory blocks. | |
template<typename T > | |
static void | FreeAligned (T *&thePtrAligned) |
Template version of function FreeAligned(), nullifies the argument pointer. | |
static Standard_Integer | Purge () |
Deallocates the storage retained on the free list and clears the list. Returns non-zero if some memory has been actually freed. | |
static Standard_Boolean | StackTrace (char *theBuffer, const int theBufferSize, const int theNbTraces, void *theContext=NULL, const int theNbTopSkip=0) |
Appends backtrace to a message buffer. Stack information might be incomplete in case of stripped binaries. Implementation details: | |
The package Standard provides global memory allocator and other basic services used by other OCCT components.
|
strong |
|
static |
Allocates memory blocks theSize - bytes to allocate.
|
static |
Allocates aligned memory blocks. Should be used with CPU instructions which require specific alignment. For example: SSE requires 16 bytes, AVX requires 32 bytes.
theSize | bytes to allocate |
theAlign | alignment in bytes |
|
static |
Allocates memory blocks theSize - bytes to allocate.
|
static |
Deallocates memory blocks.
thePtr | - previously allocated memory block to be freed |
Template version of function Free(), nullifies the argument pointer.
thePtr | - previously allocated memory block to be freed |
|
static |
Deallocates memory blocks.
thePtrAligned | the memory block previously allocated with AllocateAligned() |
Template version of function FreeAligned(), nullifies the argument pointer.
thePtrAligned | the memory block previously allocated with AllocateAligned() |
|
static |
Returns default allocator type.
|
static |
Deallocates the storage retained on the free list and clears the list. Returns non-zero if some memory has been actually freed.
|
static |
Reallocates memory blocks theStorage - previously allocated memory block theNewSize - new size in bytes.
|
static |
Appends backtrace to a message buffer. Stack information might be incomplete in case of stripped binaries. Implementation details:
theBuffer | [in] [out] message buffer to extend |
theBufferSize | [in] message buffer size |
theNbTraces | [in] maximum number of stack traces |
theContext | [in] optional platform-dependent frame context; in case of DbgHelp (Windows) should be a pointer to CONTEXT |
theNbTopSkip | [in] number of traces on top of the stack to skip |