use <memory> for replacement new
This commit is contained in:
@@ -24,12 +24,18 @@ subject to the following restrictions:
|
|||||||
///then the btAlignedObjectArray doesn't support objects with virtual methods, and non-trivial constructors/destructors
|
///then the btAlignedObjectArray doesn't support objects with virtual methods, and non-trivial constructors/destructors
|
||||||
///see discussion here: http://continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1231
|
///see discussion here: http://continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1231
|
||||||
#define USE_NEW_INPLACE_NEW 1
|
#define USE_NEW_INPLACE_NEW 1
|
||||||
|
|
||||||
#ifdef USE_NEW_INPLACE_NEW
|
#ifdef USE_NEW_INPLACE_NEW
|
||||||
#include <new.h> //in-place new
|
#include <memory> //for replacement new
|
||||||
#include <string.h> //memcpy
|
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <string.h>//for memcpy
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif //USE_NEW_INPLACE_NEW
|
#endif //USE_NEW_INPLACE_NEW
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///btAlignedObjectArray uses a subset of the stl::vector interface for its methods
|
///btAlignedObjectArray uses a subset of the stl::vector interface for its methods
|
||||||
///It is developed to replace stl::vector to avoid STL alignment issues to add SIMD/SSE data
|
///It is developed to replace stl::vector to avoid STL alignment issues to add SIMD/SSE data
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@@ -168,7 +174,7 @@ class btAlignedObjectArray
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SIMD_FORCE_INLINE T& expand( T& fillValue=T())
|
SIMD_FORCE_INLINE T& expand( const T& fillValue=T())
|
||||||
{
|
{
|
||||||
int sz = size();
|
int sz = size();
|
||||||
if( sz == capacity() )
|
if( sz == capacity() )
|
||||||
|
|||||||
Reference in New Issue
Block a user