- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/bullet/LinearMath/btAlignedAllocator.cpp
r2907 r2908 20 20 int gTotalBytesAlignedAllocs = 0;//detect memory leaks 21 21 22 static void *btAllocDefault(size_t size)23 {24 return malloc(size);25 }26 27 static void btFreeDefault(void *ptr)28 {29 free(ptr);30 }31 32 static btAllocFunc *sAllocFunc = btAllocDefault;33 static btFreeFunc *sFreeFunc = btFreeDefault;34 35 36 37 22 #if defined (BT_HAS_ALIGNED_ALLOCATOR) 38 23 #include <malloc.h> … … 65 50 unsigned long offset; 66 51 67 real = (char *) sAllocFunc(size + sizeof(void *) + (alignment-1));52 real = (char *)malloc(size + sizeof(void *) + (alignment-1)); 68 53 if (real) { 69 54 offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1); … … 82 67 if (ptr) { 83 68 real = *((void **)(ptr)-1); 84 sFreeFunc(real);69 free(real); 85 70 } 86 71 } 87 72 #endif 88 73 74 static void *btAllocDefault(size_t size) 75 { 76 return malloc(size); 77 } 78 79 static void btFreeDefault(void *ptr) 80 { 81 free(ptr); 82 } 89 83 90 84 static btAlignedAllocFunc *sAlignedAllocFunc = btAlignedAllocDefault; 91 85 static btAlignedFreeFunc *sAlignedFreeFunc = btAlignedFreeDefault; 86 static btAllocFunc *sAllocFunc = btAllocDefault; 87 static btFreeFunc *sFreeFunc = btFreeDefault; 92 88 93 89 void btAlignedAllocSetCustomAligned(btAlignedAllocFunc *allocFunc, btAlignedFreeFunc *freeFunc)
Note: See TracChangeset
for help on using the changeset viewer.