Blender V2.61 - r43446
Functions | Variables

btAlignedAllocator.cpp File Reference

#include "btAlignedAllocator.h"

Go to the source code of this file.

Functions

static void * btAllocDefault (size_t size)
static void btFreeDefault (void *ptr)
static void * btAlignedAllocDefault (size_t size, int alignment)
static void btAlignedFreeDefault (void *ptr)
void btAlignedAllocSetCustomAligned (btAlignedAllocFunc *allocFunc, btAlignedFreeFunc *freeFunc)
 If the developer has already an custom aligned allocator, then btAlignedAllocSetCustomAligned can be used. The default aligned allocator pre-allocates extra memory using the non-aligned allocator, and instruments it.
void btAlignedAllocSetCustom (btAllocFunc *allocFunc, btFreeFunc *freeFunc)
 The developer can let all Bullet memory allocations go through a custom memory allocator, using btAlignedAllocSetCustom.
void * btAlignedAllocInternal (size_t size, int alignment)
void btAlignedFreeInternal (void *ptr)

Variables

int gNumAlignedAllocs = 0
int gNumAlignedFree = 0
int gTotalBytesAlignedAllocs = 0
static btAllocFuncsAllocFunc = btAllocDefault
static btFreeFuncsFreeFunc = btFreeDefault
static btAlignedAllocFuncsAlignedAllocFunc = btAlignedAllocDefault
static btAlignedFreeFuncsAlignedFreeFunc = btAlignedFreeDefault

Function Documentation

static void* btAlignedAllocDefault ( size_t  size,
int  alignment 
) [inline, static]

Definition at line 61 of file btAlignedAllocator.cpp.

References sAllocFunc.

Referenced by btAlignedAllocSetCustomAligned().

void* btAlignedAllocInternal ( size_t  size,
int  alignment 
)

we probably replace this with our own aligned memory allocator so we replace _aligned_malloc and _aligned_free with our own that is better portable and more predictable

Definition at line 160 of file btAlignedAllocator.cpp.

References gNumAlignedAllocs, and sAlignedAllocFunc.

void btAlignedAllocSetCustom ( btAllocFunc allocFunc,
btFreeFunc freeFunc 
)

The developer can let all Bullet memory allocations go through a custom memory allocator, using btAlignedAllocSetCustom.

Definition at line 99 of file btAlignedAllocator.cpp.

References btAllocDefault(), btFreeDefault(), sAllocFunc, and sFreeFunc.

void btAlignedAllocSetCustomAligned ( btAlignedAllocFunc allocFunc,
btAlignedFreeFunc freeFunc 
)

If the developer has already an custom aligned allocator, then btAlignedAllocSetCustomAligned can be used. The default aligned allocator pre-allocates extra memory using the non-aligned allocator, and instruments it.

Definition at line 93 of file btAlignedAllocator.cpp.

References btAlignedAllocDefault(), btAlignedFreeDefault(), sAlignedAllocFunc, and sAlignedFreeFunc.

static void btAlignedFreeDefault ( void *  ptr) [inline, static]

Definition at line 78 of file btAlignedAllocator.cpp.

References sFreeFunc.

Referenced by btAlignedAllocSetCustomAligned().

void btAlignedFreeInternal ( void *  ptr)

Definition at line 169 of file btAlignedAllocator.cpp.

References gNumAlignedFree, and sAlignedFreeFunc.

static void* btAllocDefault ( size_t  size) [static]

Definition at line 22 of file btAlignedAllocator.cpp.

Referenced by btAlignedAllocSetCustom().

static void btFreeDefault ( void *  ptr) [static]

Definition at line 27 of file btAlignedAllocator.cpp.

References addon::engine::free().

Referenced by btAlignedAllocSetCustom().


Variable Documentation

Definition at line 18 of file btAlignedAllocator.cpp.

Referenced by btAlignedAllocInternal().

int gNumAlignedFree = 0

Definition at line 19 of file btAlignedAllocator.cpp.

Referenced by btAlignedFreeInternal().

Definition at line 20 of file btAlignedAllocator.cpp.

btAlignedAllocFunc* sAlignedAllocFunc = btAlignedAllocDefault [static]
btAlignedFreeFunc* sAlignedFreeFunc = btAlignedFreeDefault [static]

Definition at line 91 of file btAlignedAllocator.cpp.

Referenced by btAlignedAllocSetCustomAligned(), and btAlignedFreeInternal().

btAllocFunc* sAllocFunc = btAllocDefault [static]

Definition at line 32 of file btAlignedAllocator.cpp.

Referenced by btAlignedAllocDefault(), and btAlignedAllocSetCustom().

btFreeFunc* sFreeFunc = btFreeDefault [static]

Definition at line 33 of file btAlignedAllocator.cpp.

Referenced by btAlignedAllocSetCustom(), and btAlignedFreeDefault().