Nuke binary plugins 15.1.3
 
Loading...
Searching...
No Matches
DD::Image::HeapAllocator Class Reference

#include <HeapAllocator.h>

Inheritance diagram for DD::Image::HeapAllocator:
DD::Image::IAllocator

Public Member Functions

 HeapAllocator (const char *allocatorName)
 
void * allocate (size_t size)
 
template<typename T >
T * allocate (size_t numItems)
 
template<typename T >
T * New ()
 
void deallocate (void *memory)
 
void setObjAddress (void *address)
 
template<typename T >
void Delete (T *memory)
 
const char * getName () const override
 
const char * getType () const override
 
size_t getRequestedUsage () const override
 
size_t getRequestedHighWaterMark () const override
 
void resetHighWaterMark () override
 
virtual const AllocationTracker * getTracker () const
 
- Public Member Functions inherited from DD::Image::IAllocator
virtual const char * getName () const =0
 Return the name for this allocator.
 
virtual const char * getType () const =0
 Return the type name for this allocator (e.g. "HeapAllocator")
 
virtual size_t getRequestedUsage () const =0
 Returns the sum total requested by the user.
 
virtual size_t getAllocatorUsage () const
 
virtual size_t getRequestedHighWaterMark () const =0
 Returns the high watermark for the requested allocations.
 
virtual size_t getAllocatorHighWaterMark () const
 
virtual void resetHighWaterMark ()=0
 Resets the high watermark for the allocator.
 

Additional Inherited Members

- Static Public Member Functions inherited from DD::Image::IAllocator
template<typename T >
static T * getAllocator (IAllocator *pAllocator)
 Helper function for returning a concrete allocator type.
 

Detailed Description

Heap Allocator

This is a very simple, thread-safe Heap allocator which calls through to DD::Image::Memory and tracks how much memory its using. Additionally, if FN_TRACK_MEMORY_ALLOCATIONS is defined (in Memory.h), and the NUKE_TRACK_OBJECT_ALLOCATIONS environment variable is set to 1, allocations using this allocator will be tracked between checkpoints, so that leaks can be identified. See the _nuke_internal.memAllocCheckpoint()/memAllocInfo() Python API calls for details.

Member Function Documentation

◆ setObjAddress()

void DD::Image::HeapAllocator::setObjAddress ( void *  address)

Called from constructors of objects allocated using this allocator with their this pointer. This allows the allocation tracker to track the actual object address within an allocated block.

◆ getName()

const char * DD::Image::HeapAllocator::getName ( ) const
overridevirtual

Implements DD::Image::IAllocator.

◆ getType()

const char * DD::Image::HeapAllocator::getType ( ) const
overridevirtual

Implements DD::Image::IAllocator.

◆ getRequestedUsage()

size_t DD::Image::HeapAllocator::getRequestedUsage ( ) const
overridevirtual

Implements DD::Image::IAllocator.

◆ getRequestedHighWaterMark()

size_t DD::Image::HeapAllocator::getRequestedHighWaterMark ( ) const
overridevirtual

Implements DD::Image::IAllocator.

◆ resetHighWaterMark()

void DD::Image::HeapAllocator::resetHighWaterMark ( )
overridevirtual

Implements DD::Image::IAllocator.



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com