From 05ed086d28b9c5c9c08fd87dc20b16579dfc7317 Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 28 Feb 2020 09:30:52 +0800 Subject: [PATCH] Remove global variables in btAlignedAllocator --- lib/bullet/src/LinearMath/btAlignedAllocator.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/bullet/src/LinearMath/btAlignedAllocator.cpp b/lib/bullet/src/LinearMath/btAlignedAllocator.cpp index 874d9d02e..b2512df17 100644 --- a/lib/bullet/src/LinearMath/btAlignedAllocator.cpp +++ b/lib/bullet/src/LinearMath/btAlignedAllocator.cpp @@ -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); }