diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2007-06-23 09:28:07 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2007-06-23 09:28:07 +0400 |
commit | ca26aeb7b23e37e65f49d907ea53fcaeee77ad4e (patch) | |
tree | b6530195a8ef5d874b9fc2bbb9574f1484781be5 /extern/bullet2/src/LinearMath/btAlignedAllocator.cpp | |
parent | 14ad8c9941ac1e6f5252a843c6ad17653cbbd689 (diff) |
upgrade to latest Bullet 2.53. cross the fingers it doesn't break one of the exotic or less exotic platforms
Diffstat (limited to 'extern/bullet2/src/LinearMath/btAlignedAllocator.cpp')
-rw-r--r-- | extern/bullet2/src/LinearMath/btAlignedAllocator.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp b/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp index 19b811b0ce8..1f5877fa37e 100644 --- a/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp +++ b/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp @@ -16,7 +16,7 @@ subject to the following restrictions: #include "btAlignedAllocator.h" -#if defined (WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) +#if defined (BT_HAS_ALIGNED_ALOCATOR) #include <malloc.h> void* btAlignedAlloc (int size, int alignment) @@ -31,6 +31,26 @@ void btAlignedFree (void* ptr) #else +#ifdef __CELLOS_LV2__ + +#include <stdlib.h> + +int numAllocs = 0; +int numFree = 0; + +void* btAlignedAlloc (int size, int alignment) +{ + numAllocs++; + return memalign(alignment, size); +} + +void btAlignedFree (void* ptr) +{ + numFree++; + free(ptr); +} + +#else ///todo ///will add some multi-platform version that works without _aligned_malloc/_aligned_free @@ -41,7 +61,10 @@ void* btAlignedAlloc (int size, int alignment) void btAlignedFree (void* ptr) { - delete ptr; + delete [] (char*) ptr; } +#endif // #endif + + |