favreau / bullet

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

ConvexDecomposition::ConvexResult way over-allocating #528

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
All of the allocations via new in ConvexDecomposition.h ( starting at line 77 ) 
be allocating : n * sizeof(type) * 3.
Based on the memcpy below, the allocation is [likely] 4 times as much as 
needed/used.

While their, rather than checking the count arguments to the constructors, you 
might want to check the pointer for non-null.  As the ConvexResult interface is 
somewhat public, one might want to construct an object with valid counts, and 
fill in the allocated memory later.

Maybe I'm missing a finer point of the inner workings, but initial tests work 
pretty well...

Original issue reported on code.google.com by pomahka...@gmail.com on 6 Aug 2011 at 1:11

Attachments:

GoogleCodeExporter commented 9 years ago
see https://github.com/bulletphysics/bullet3/issues/139

Original comment by erwin.coumans on 30 Mar 2014 at 7:42