Open CASCADE Technology
6.9.0
|
#include <NIS_Allocator.hxx>
Public Member Functions | |
NIS_Allocator (const size_t theBlockSize=24600) | |
Standard_Size | NAllocated () const |
Standard_Size | NFreed () const |
void | ResetCounters () |
virtual void * | Allocate (const size_t size) |
virtual void | Free (void *anAddress) |
Free a previously allocated memory. Does nothing. More... | |
![]() | |
NCollection_IncAllocator (const size_t theBlockSize=DefaultBlockSize) | |
Constructor. More... | |
size_t | GetMemSize () const |
Diagnostic method, returns the total allocated size. More... | |
~NCollection_IncAllocator () | |
Destructor (calls Clean() internally) More... | |
void * | Reallocate (void *anAddress, const size_t oldSize, const size_t newSize) |
Reallocation: it is always allowed but is only efficient with the last allocated item. More... | |
void | Reset (const Standard_Boolean doReleaseMem=Standard_True) |
Re-initialize the allocator so that the next Allocate call should start allocating in the very begining as though the allocator is just constructed. Warning: make sure that all previously allocated data are no more used in your code! More... | |
![]() | |
virtual void | Delete () const |
Memory deallocator for transient classes. More... | |
![]() | |
Standard_Transient () | |
Empty constructor. More... | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. More... | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. More... | |
virtual | ~Standard_Transient () |
Destructor must be virtual. More... | |
virtual const Handle_Standard_Type & | DynamicType () const |
Returns a type information object about this object. More... | |
Standard_Boolean | IsInstance (const Handle_Standard_Type &theType) const |
Returns a true value if this is an instance of Type. More... | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. More... | |
Standard_Boolean | IsKind (const Handle_Standard_Type &theType) const |
Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
virtual Handle_Standard_Transient | This () const |
Returns a Handle which references this object. Must never be called to objects created in stack. More... | |
Standard_Integer | GetRefCount () const |
Get the reference counter of this object. More... | |
Additional Inherited Members | |
![]() | |
typedef void * | aligned_t |
![]() | |
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. More... | |
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. More... | |
static void | PrintMemUsageStatistics () |
Prints memory usage statistics cumulated by StandardCallBack. More... | |
![]() | |
static const size_t | DefaultBlockSize = 24600 |
![]() | |
void | Clean () |
Flush all previously allocated data. All pointers returned by Allocate() become invalid – be very careful with this. More... | |
void * | allocateNewBlock (const size_t cSize) |
Allocate a new block and return a pointer to it ** only for internal usage **. More... | |
![]() | |
NCollection_BaseAllocator (void) | |
Constructor - prohibited. More... | |
![]() | |
IBlock * | myFirstBlock |
size_t | mySize |
size_t | myMemSize |
Subclass of Incremental Allocator. It is aware of the total allocated and released memory. Used in NIS_Interactive context as private allocator that manages all memory used by interactive objects.
NIS_Allocator::NIS_Allocator | ( | const size_t | theBlockSize = 24600 | ) |
Constructor.
|
virtual |
Allocate memory with given size. Returns NULL on failure
Reimplemented from NCollection_IncAllocator.
|
virtual |
Free a previously allocated memory. Does nothing.
Reimplemented from NCollection_IncAllocator.
|
inline |
Query the total number of allocated bytes
|
inline |
Query the total number of released bytes
void NIS_Allocator::ResetCounters | ( | ) |
Set both counters to zero. Should be called with method Reset of the base class NCollection_IncAlocator.