favreau / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Various btQuickprof classes don't use custom memory allocator #529

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Various classes like btClockData, CProfileNode and CProfileIterator are 
allocated using global operator new instead of placement new with the 
optionally user-supplied allocator set via 
btAlignedAllocSetCustom/btAlignedAllocSetCustomAligned.

Fixing this also exposes another problem. gProfileClock is a statically 
allocated instance of btClock, which does heap allocation in its ctor. Since 
global/file scope statics have indeterminate initialisation order, 
gProfileClock's ctor may allocate memory before it's possible to call 
btAlignedAllocSetCustom*.

Original issue reported on code.google.com by young.jpc@gmail.com on 7 Aug 2011 at 6:09

GoogleCodeExporter commented 9 years ago
The btQuickprof is just for debugging purposes and not for production/release 
code, so it shouldn't be a bit issue.

If it is causing issues, you can disable btQuickprof

//#define BT_NO_PROFILE 0
//#define USE_BT_CLOCK 0

Or do you have a suggestion for a fix?

Original comment by erwin.coumans on 7 Aug 2011 at 5:17

GoogleCodeExporter commented 9 years ago
BT_NO_PROFILE works. Not really worth the effort to fix it, since as you say, 
it's just for debugging.

Original comment by young.jpc@gmail.com on 8 Aug 2011 at 5:18

GoogleCodeExporter commented 9 years ago
It is better to disable/remove btQuickprof by default, and just use it in the 
demos.

I'll give it some thought, thanks for the report.

Original comment by erwin.coumans on 30 Aug 2011 at 3:59

GoogleCodeExporter commented 9 years ago
I'll make sure to document this in the user manual.

Original comment by erwin.coumans on 29 Feb 2012 at 5:25

GoogleCodeExporter commented 9 years ago
Mentioned in the manual:
http://code.google.com/p/bullet/source/detail?r=2513
thanks for the feedback!

Original comment by erwin.coumans on 1 Mar 2012 at 5:31