|
virtual int | IsA (const char *type) |
|
vtkHeap * | NewInstance () const |
|
void | PrintSelf (ostream &os, vtkIndent indent) |
|
void * | AllocateMemory (size_t n) |
|
void | Reset () |
|
char * | StringDup (const char *str) |
|
|
virtual void | SetBlockSize (size_t) |
|
virtual size_t | GetBlockSize () |
|
|
virtual int | GetNumberOfBlocks () |
|
virtual int | GetNumberOfAllocations () |
|
vtkObject * | NewInstance () const |
|
virtual void | DebugOn () |
|
virtual void | DebugOff () |
|
bool | GetDebug () |
|
void | SetDebug (bool debugFlag) |
|
virtual void | Modified () |
|
virtual unsigned long | GetMTime () |
|
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
|
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
|
vtkCommand * | GetCommand (unsigned long tag) |
|
void | RemoveObserver (vtkCommand *) |
|
void | RemoveObservers (unsigned long event, vtkCommand *) |
|
void | RemoveObservers (const char *event, vtkCommand *) |
|
int | HasObserver (unsigned long event, vtkCommand *) |
|
int | HasObserver (const char *event, vtkCommand *) |
|
void | RemoveObserver (unsigned long tag) |
|
void | RemoveObservers (unsigned long event) |
|
void | RemoveObservers (const char *event) |
|
void | RemoveAllObservers () |
|
int | HasObserver (unsigned long event) |
|
int | HasObserver (const char *event) |
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
|
int | InvokeEvent (unsigned long event, void *callData) |
|
int | InvokeEvent (const char *event, void *callData) |
|
int | InvokeEvent (unsigned long event) |
|
int | InvokeEvent (const char *event) |
|
const char * | GetClassName () const |
|
virtual void | Delete () |
|
virtual void | FastDelete () |
|
void | Print (ostream &os) |
|
virtual void | Register (vtkObjectBase *o) |
|
virtual void | UnRegister (vtkObjectBase *o) |
|
void | SetReferenceCount (int) |
|
void | PrintRevisions (ostream &) |
|
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
|
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
|
int | GetReferenceCount () |
|
replacement for malloc/free and new/delete
This class is a replacement for malloc/free and new/delete for software that has inherent memory leak or performance problems. For example, external software such as the PLY library (vtkPLY) and VRML importer (vtkVRMLImporter) are often written with lots of malloc() calls but without the corresponding free() invocations. The class vtkOrderedTriangulator may create and delete millions of new/delete calls. This class allows the overloading of the C++ new operator (or other memory allocation requests) by using the method AllocateMemory(). Memory is deleted with an invocation of CleanAll() (which deletes ALL memory; any given memory allocation cannot be deleted). Note: a block size can be used to control the size of each memory allocation. Requests for memory are fulfilled from the block until the block runs out, then a new block is created.
- Warning
- Do not use this class as a general replacement for system memory allocation. This class should be used only as a last resort if memory leaks cannot be tracked down and eliminated by conventional means. Also, deleting memory from vtkHeap is not supported. Only the deletion of the entire heap is. (A Reset() method allows you to reuse previously allocated memory.)
- See also
- vtkVRMLImporter vtkPLY vtkOrderedTriangulator
Definition at line 52 of file vtkHeap.h.