PxAllocatorCallback Class Referenceabstract

Abstract base class for an application defined memory allocator that can be used by the Nv library. More...

#include <PxAllocatorCallback.h>

Inheritance diagram for PxAllocatorCallback:

Public Member Functions

virtual ~PxAllocatorCallback ()
 destructor More...
 
virtual void * allocate (size_t size, const char *typeName, const char *filename, int line)=0
 Allocates size bytes of memory, which must be 16-byte aligned. More...
 
virtual void deallocate (void *ptr)=0
 Frees memory previously allocated by allocate(). More...
 

Detailed Description

Abstract base class for an application defined memory allocator that can be used by the Nv library.

Note
The SDK state should not be modified from within any allocation/free function.

Threading: All methods of this class should be thread safe as it can be called from the user thread or the physics processing thread(s).

Constructor & Destructor Documentation

◆ ~PxAllocatorCallback()

virtual PxAllocatorCallback::~PxAllocatorCallback ( )
inlinevirtual

destructor

Member Function Documentation

◆ allocate()

virtual void* PxAllocatorCallback::allocate ( size_t  size,
const char *  typeName,
const char *  filename,
int  line 
)
pure virtual

Allocates size bytes of memory, which must be 16-byte aligned.

This method should never return NULL. If you run out of memory, then you should terminate the app or take some other appropriate action.

Threading: This function should be thread safe as it can be called in the context of the user thread and physics processing thread(s).

Parameters
sizeNumber of bytes to allocate.
typeNameName of the datatype that is being allocated
filenameThe source file which allocated the memory
lineThe source line which allocated the memory
Returns
The allocated block of memory.

Implemented in PxDefaultAllocator.

Referenced by PxSerializerDefaultAdapter< T >::exportData().

◆ deallocate()

virtual void PxAllocatorCallback::deallocate ( void *  ptr)
pure virtual

Frees memory previously allocated by allocate().

Threading: This function should be thread safe as it can be called in the context of the user thread and physics processing thread(s).

Parameters
ptrMemory to free.

Implemented in PxDefaultAllocator.

Referenced by PxSerializerDefaultAdapter< T >::exportData().


The documentation for this class was generated from the following file: