Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 12:58:47 AM (15 years ago)
Author:
dafrick
Message:

Reverted to revision 2906 (because I'm too stupid to merge correctly, 2nd try will follow shortly. ;))

Location:
code/branches/questsystem5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5

  • code/branches/questsystem5/src/bullet/LinearMath/btAlignedAllocator.cpp

    r2907 r2908  
    2020int gTotalBytesAlignedAllocs = 0;//detect memory leaks
    2121
    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 
    3722#if defined (BT_HAS_ALIGNED_ALLOCATOR)
    3823#include <malloc.h>
     
    6550  unsigned long offset;
    6651
    67   real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1));
     52  real = (char *)malloc(size + sizeof(void *) + (alignment-1));
    6853  if (real) {
    6954    offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1);
     
    8267  if (ptr) {
    8368    real = *((void **)(ptr)-1);
    84     sFreeFunc(real);
     69    free(real);
    8570  }
    8671}
    8772#endif
    8873
     74static void *btAllocDefault(size_t size)
     75{
     76        return malloc(size);
     77}
     78
     79static void btFreeDefault(void *ptr)
     80{
     81        free(ptr);
     82}
    8983
    9084static btAlignedAllocFunc *sAlignedAllocFunc = btAlignedAllocDefault;
    9185static btAlignedFreeFunc *sAlignedFreeFunc = btAlignedFreeDefault;
     86static btAllocFunc *sAllocFunc = btAllocDefault;
     87static btFreeFunc *sFreeFunc = btFreeDefault;
    9288
    9389void btAlignedAllocSetCustomAligned(btAlignedAllocFunc *allocFunc, btAlignedFreeFunc *freeFunc)
Note: See TracChangeset for help on using the changeset viewer.