Remove global variables in btAlignedAllocator

This commit is contained in:
Benau 2020-02-28 09:30:52 +08:00
parent 336883e2e7
commit 05ed086d28

View File

@ -15,9 +15,10 @@ subject to the following restrictions:
#include "btAlignedAllocator.h"
int gNumAlignedAllocs = 0;
int gNumAlignedFree = 0;
int gTotalBytesAlignedAllocs = 0;//detect memory leaks
// Disable global variables for STK with multiple physics instance
//int gNumAlignedAllocs = 0;
//int gNumAlignedFree = 0;
//int gTotalBytesAlignedAllocs = 0;//detect memory leaks
static void *btAllocDefault(size_t size)
{
@ -168,7 +169,7 @@ void btAlignedFreeInternal (void* ptr,int line,char* filename)
void* btAlignedAllocInternal (size_t size, int alignment)
{
gNumAlignedAllocs++;
//gNumAlignedAllocs++;
void* ptr;
ptr = sAlignedAllocFunc(size, alignment);
// printf("btAlignedAllocInternal %d, %x\n",size,ptr);
@ -182,7 +183,7 @@ void btAlignedFreeInternal (void* ptr)
return;
}
gNumAlignedFree++;
//gNumAlignedFree++;
// printf("btAlignedFreeInternal %x\n",ptr);
sAlignedFreeFunc(ptr);
}