Open CASCADE Technology
6.5.4
|
#include <NCollection_BaseAllocator.hxx>
Public Member Functions | |
virtual void * | Allocate (const size_t size) |
virtual void | Free (void *anAddress) |
Static Public Member Functions | |
static const Handle < NCollection_BaseAllocator > & | CommonBaseAllocator (void) |
CommonBaseAllocator This method is designed to have the only one BaseAllocator (to avoid useless copying of collections). However one can use operator new to create more BaseAllocators, but it is injurious. | |
static void | StandardCallBack (const Standard_Boolean theIsAlloc, const Standard_Address theStorage, const Standard_Size theRoundSize, const Standard_Size theSize) |
Callback function to register alloc/free calls. | |
static void | PrintMemUsageStatistics () |
Prints memory usage statistics cumulated by StandardCallBack. | |
Protected Member Functions | |
NCollection_BaseAllocator (void) | |
Constructor - prohibited. |
Purpose: Basic class for memory allocation wizards. Defines the interface for devising different allocators firstly to be used by collections of NCollection, though it it is not deferred. It allocates/frees the memory through Standard procedures, thus it is unnecessary (and sometimes injurious) to have more than one such allocator. To avoid creation of multiple objects the constructors were maid inaccessible. To create the BaseAllocator use the method CommonBaseAllocator. Note that this object is managed by Handle.
NCollection_BaseAllocator::NCollection_BaseAllocator | ( | void | ) | [inline, protected] |
virtual void* NCollection_BaseAllocator::Allocate | ( | const size_t | size | ) | [virtual] |
Reimplemented in NIS_Allocator, NCollection_IncAllocator, and NCollection_HeapAllocator.
static const Handle< NCollection_BaseAllocator >& NCollection_BaseAllocator::CommonBaseAllocator | ( | void | ) | [static] |
virtual void NCollection_BaseAllocator::Free | ( | void * | anAddress | ) | [virtual] |
Reimplemented in NIS_Allocator, NCollection_IncAllocator, and NCollection_HeapAllocator.
static void NCollection_BaseAllocator::PrintMemUsageStatistics | ( | ) | [static] |
static void NCollection_BaseAllocator::StandardCallBack | ( | const Standard_Boolean | theIsAlloc, |
const Standard_Address | theStorage, | ||
const Standard_Size | theRoundSize, | ||
const Standard_Size | theSize | ||
) | [static] |