added custom memory allocator registration, thanks to Sly.

call CProfileManager::CleanupMemory(), to cleanup btQuickprof memory.
changed include from #include <new.h> to #include <new> in btOdeQuickstepConstraintSolver.cpp
This commit is contained in:
erwin.coumans
2008-05-24 06:10:09 +00:00
parent 3a94e70370
commit 88ee734bfb
6 changed files with 147 additions and 80 deletions

View File

@@ -35,14 +35,22 @@ void* btAlignedAllocInternal (size_t size, int alignment,int line,char* filename
void btAlignedFreeInternal (void* ptr,int line,char* filename);
#else
void* btAlignedAllocInternal (std::size_t size, int alignment);
void* btAlignedAllocInternal (size_t size, int alignment);
void btAlignedFreeInternal (void* ptr);
#define btAlignedAlloc(a,b) btAlignedAllocInternal(a,b)
#define btAlignedFree(ptr) btAlignedFreeInternal(ptr)
#endif
typedef int size_type;
typedef void *(btAlignedAllocFunc)(size_t size, int alignment);
typedef void (btAlignedFreeFunc)(void *memblock);
typedef void *(btAllocFunc)(size_t size);
typedef void (btFreeFunc)(void *memblock);
void btAlignedAllocSetCustomAligned(btAlignedAllocFunc *allocFunc, btAlignedFreeFunc *freeFunc);
void btAlignedAllocSetCustom(btAllocFunc *allocFunc, btFreeFunc *freeFunc);
template < typename T , unsigned Alignment >
class btAlignedAllocator {