29#ifndef PX_DEFAULT_ALLOCATOR_H
30#define PX_DEFAULT_ALLOCATOR_H
35#include "foundation/PxAllocatorCallback.h"
36#include "foundation/PxAssert.h"
37#include "common/PxPhysXCommonConfig.h"
41#if PX_WINDOWS_FAMILY || PX_LINUX_FAMILY || PX_SWITCH
54 return _aligned_malloc(size, 16);
61#elif PX_LINUX_FAMILY || PX_SWITCH
64 return ::memalign(16, size);
75 return ::malloc(size);
90 virtual void*
allocate(
size_t size,
const char*,
const char*,
int)
92 void* ptr = platformAlignedAlloc(size);
93 PX_ASSERT((
size_t(ptr) & 15)==0);
99 platformAlignedFree(ptr);
Abstract base class for an application defined memory allocator that can be used by the Nv library.
Definition PxAllocatorCallback.h:53
default implementation of the allocator interface required by the SDK
Definition PxDefaultAllocator.h:88
virtual void * allocate(size_t size, const char *, const char *, int)
Allocates size bytes of memory, which must be 16-byte aligned.
Definition PxDefaultAllocator.h:90
virtual void deallocate(void *ptr)
Frees memory previously allocated by allocate().
Definition PxDefaultAllocator.h:97
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39