RavEngine
Loading...
Searching...
No Matches
physx::PxBroadcastingAllocator Class Reference

Abstract base class for an application defined memory allocator that allows an external listener to audit the memory allocations. More...

#include <PxBroadcast.h>

Inheritance diagram for physx::PxBroadcastingAllocator:
[legend]
Collaboration diagram for physx::PxBroadcastingAllocator:
[legend]

Public Member Functions

 PxBroadcastingAllocator (PxAllocatorCallback &allocator, PxErrorCallback &error)
 The default constructor.
 
virtual ~PxBroadcastingAllocator ()
 The default constructor.
 
void * allocate (size_t size, const char *typeName, const char *filename, int line)
 Allocates size bytes of memory, which must be 16-byte aligned.
 
void deallocate (void *ptr)
 Frees memory previously allocated by allocate().
 
- Public Member Functions inherited from physx::PxBroadcast< PxAllocationListener, PxAllocatorCallback >
 PxBroadcast ()
 The default constructor.
 
void registerListener (PxAllocationListener &listener)
 Register new listener.
 
void deregisterListener (PxAllocationListener &listener)
 Deregister an existing listener.
 
uint32_t getNbListeners () const
 Get number of registered listeners.
 
PxAllocationListener & getListener (uint32_t index)
 Get an existing listener from given index.
 
- Public Member Functions inherited from physx::PxAllocatorCallback
virtual ~PxAllocatorCallback ()
 destructor
 

Additional Inherited Members

- Static Public Attributes inherited from physx::PxBroadcast< PxAllocationListener, PxAllocatorCallback >
static const uint32_t MAX_NB_LISTENERS
 
- Protected Attributes inherited from physx::PxBroadcast< PxAllocationListener, PxAllocatorCallback >
physx::PxInlineArray< PxAllocationListener *, MAX_NB_LISTENERS, physx::PxAllocator > mListeners
 

Detailed Description

Abstract base class for an application defined memory allocator that allows an external listener to audit the memory allocations.

Member Function Documentation

◆ allocate()

void * physx::PxBroadcastingAllocator::allocate ( size_t  size,
const char *  typeName,
const char *  filename,
int  line 
)
inlinevirtual

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.

Implements physx::PxAllocatorCallback.

◆ deallocate()

void physx::PxBroadcastingAllocator::deallocate ( void *  ptr)
inlinevirtual

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.

Implements physx::PxAllocatorCallback.


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