- keep track of all memory allocations (gNumAllignedAllocs/gNumAllignedFree)
All memory allocations in Bullet go through btAlignedAlloc/btAlignedFree Fix in hinge constraint constructors, thanks Marcus Hennix!
This commit is contained in:
@@ -41,6 +41,9 @@ btCollisionShape* gShapePtr[maxNumObjects];//1 rigidbody has 1 shape (no re-use
|
||||
#ifdef SHOW_NUM_DEEP_PENETRATIONS
|
||||
extern int gNumDeepPenetrationChecks;
|
||||
extern int gNumGjkChecks;
|
||||
extern int gNumAlignedAllocs;
|
||||
extern int gNumAlignedFree;
|
||||
|
||||
#endif //
|
||||
|
||||
|
||||
@@ -885,6 +888,7 @@ void DemoApplication::renderme()
|
||||
|
||||
#ifdef SHOW_NUM_DEEP_PENETRATIONS
|
||||
|
||||
|
||||
glRasterPos3f(xOffset,yStart,0);
|
||||
sprintf(buf,"gNumDeepPenetrationChecks = %d",gNumDeepPenetrationChecks);
|
||||
BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf);
|
||||
@@ -895,6 +899,22 @@ void DemoApplication::renderme()
|
||||
BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf);
|
||||
yStart += yIncr;
|
||||
|
||||
|
||||
glRasterPos3f(xOffset,yStart,0);
|
||||
sprintf(buf,"gNumAlignedAllocs = %d",gNumAlignedAllocs);
|
||||
BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf);
|
||||
yStart += yIncr;
|
||||
|
||||
glRasterPos3f(xOffset,yStart,0);
|
||||
sprintf(buf,"gNumAlignedFree= %d",gNumAlignedFree);
|
||||
BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf);
|
||||
yStart += yIncr;
|
||||
|
||||
glRasterPos3f(xOffset,yStart,0);
|
||||
sprintf(buf,"# alloc-free = %d",gNumAlignedAllocs-gNumAlignedFree);
|
||||
BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf);
|
||||
yStart += yIncr;
|
||||
|
||||
#endif //SHOW_NUM_DEEP_PENETRATIONS
|
||||
|
||||
resetPerspectiveProjection();
|
||||
|
||||
Reference in New Issue
Block a user