- Timestamp:
- Apr 8, 2009, 12:36:08 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
r2662 r2907 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 22 37 #if defined (BT_HAS_ALIGNED_ALLOCATOR) 23 38 #include <malloc.h> … … 50 65 unsigned long offset; 51 66 52 real = (char *) malloc(size + sizeof(void *) + (alignment-1));67 real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1)); 53 68 if (real) { 54 69 offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1); … … 67 82 if (ptr) { 68 83 real = *((void **)(ptr)-1); 69 free(real);84 sFreeFunc(real); 70 85 } 71 86 } 72 87 #endif 73 88 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 }83 89 84 90 static btAlignedAllocFunc *sAlignedAllocFunc = btAlignedAllocDefault; 85 91 static btAlignedFreeFunc *sAlignedFreeFunc = btAlignedFreeDefault; 86 static btAllocFunc *sAllocFunc = btAllocDefault;87 static btFreeFunc *sFreeFunc = btFreeDefault;88 92 89 93 void btAlignedAllocSetCustomAligned(btAlignedAllocFunc *allocFunc, btAlignedFreeFunc *freeFunc)
Note: See TracChangeset
for help on using the changeset viewer.