PhysX SDK 3.2 API Reference: PxDefaultAllocator Class Reference

PhysX SDK 3.2 API

PxDefaultAllocator Class Reference
[Extensions]

default implementation of the allocator interface required by the SDK More...

#include <PxDefaultAllocator.h>

Inheritance diagram for PxDefaultAllocator:
Collaboration diagram for PxDefaultAllocator:

List of all members.


Public Member Functions

void * allocate (size_t size, const char *, const char *, int)
 Allocates size bytes of memory, which must be 16-byte aligned.
void deallocate (void *ptr)
 Frees memory previously allocated by allocate().

Detailed Description

default implementation of the allocator interface required by the SDK

Member Function Documentation

void* PxDefaultAllocator::allocate ( size_t  size,
const char *  typeName,
const char *  filename,
int  line 
) [inline, 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:
size Number of bytes to allocate.
typeName Name of the datatype that is being allocated
filename The source file which allocated the memory
line The source line which allocated the memory
Returns:
The allocated block of memory.

Implements PxAllocatorCallback.

References PX_ASSERT.

void PxDefaultAllocator::deallocate ( void *  ptr  )  [inline, 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:
ptr Memory to free.

Implements PxAllocatorCallback.


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



Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com