PxPinnedHostAllocatorCallback#

Defined in include/cudamanager/PxCudaContextManager.h

class PxPinnedHostAllocatorCallback#

An interface class that the user can implement in order for PhysX to use a user-defined host pinned memory allocator.

Public Functions

virtual bool memAlloc(void **ptr, size_t size, PxU32 flags) = 0#

Allocates host pinned memory.

Parameters:
  • ptr[in] Output pointer to the allocated memory. The returned address must be 256 bytes aligned.

  • size[in] The amount of memory to be allocated.

  • flags[in] CUDA allocation flags (e.g., CU_MEMHOSTALLOC_DEVICEMAP, CU_MEMHOSTALLOC_PORTABLE)

Returns:

A boolean indicating whether the allocation succeeded or not.

virtual bool memFree(void *ptr) = 0#

Frees host pinned memory.

Parameters:

ptr[in] The memory to free.

Returns:

A boolean indicating whether the deallocation succeeded or not.

Protected Functions

inline virtual ~PxPinnedHostAllocatorCallback()#