<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/3638" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2010-05-02T06:32:20+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/3638</id>

		<entry>
		<author><name><![CDATA[ngbinh]]></name></author>
		<updated>2010-05-02T06:32:20+00:00</updated>

		<published>2010-05-02T06:32:20+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=18430#p18430</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=18430#p18430"/>
		<title type="html"><![CDATA[Re: 16 byte alignment issue in vector&lt; btVector3 &gt;]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=18430#p18430"><![CDATA[
<blockquote class="uncited"><div>I am having a similar issue.<br><br>I am using boost::python to wrap c++ classes which use Bullet. If any class contains a btVector3 member, it will not compile, or if I try to expose btVector3 as a boost::python object.<br><br>Here's the result:<br><div class="codebox"><p>Code: </p><pre><code>C:\boost_1_38_0\boost/python/converter/as_to_python_function.hpp(21) : error C2719: 'unnamed-parameter': formal parameter with __declspec(align('16')) won't be aligned        C:\boost_1_38_0\boost/python/to_python_converter.hpp(88) : see reference to class template instantiation 'boost::python::converter::as_to_python_function&lt;T,ToPython&gt;' being compiled        with        [            T=btVector3,            [snip]</code></pre></div>I gather this is because of the btAlignmentAllocator used by btVector3. When boost::python exposes a c++ object to python it passes by value.<br>  <br>I've even tried stlport but this has no effect.<br><br>Is there anyway I can define-out the use of btAlignmentAllocator and suffer the performance penalties? Meanwhile I will try to find out how to pass-by-ref in boost::python.<br><br>Thanks<br><br>Simon</div></blockquote>You can remove #define BT_USE_SSE and change <br><br><br>//#define SIMD_FORCE_INLINE __forceinline<br>//#define ATTRIBUTE_ALIGNED16(a) __declspec(align(16)) a<br>//#define ATTRIBUTE_ALIGNED64(a) __declspec(align(64)) a<br>//#define ATTRIBUTE_ALIGNED128(a) __declspec (align(128)) a<br>#define SIMD_FORCE_INLINE inline<br>#define ATTRIBUTE_ALIGNED16(a) a<br>#define ATTRIBUTE_ALIGNED64(a) a<br>#define ATTRIBUTE_ALIGNED128(a) a<br><br>then you should be fine. <br><br>Bullet is flexible enough I guess. But be warned, you will loose performance.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=225">ngbinh</a> — Sun May 02, 2010 6:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[loefje]]></name></author>
		<updated>2009-09-12T21:39:29+00:00</updated>

		<published>2009-09-12T21:39:29+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=15175#p15175</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=15175#p15175"/>
		<title type="html"><![CDATA[Re: 16 byte alignment issue in vector&lt; btVector3 &gt;]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=15175#p15175"><![CDATA[
hi again,<br><br>I'm having some trouble with the btAlignedObjectArray,<br>when I'm returning one from a function, after some swapping,pushing, etc.<br>my code crashes in aligned_free_dbg. I have no idea what's going on. <br>I dont have dynamic data allocation going on, so I wonder if it's a bug<br>in btAlignedObjectArray. (see linked image at <a href="http://www.dynamica.org/PUB/crash.jpg" class="postlink">www.dynamica.org/PUB/crash.jpg</a> )<br><br>I hope anyone can shed some light on this issue.<br><br>TIA,<br><br>jochem van der Spek<br><br><img src="http://www.dynamica.org/PUB/crash.jpg" class="postimage" alt="Image"><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=5191">loefje</a> — Sat Sep 12, 2009 9:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sipickles]]></name></author>
		<updated>2009-06-24T12:27:58+00:00</updated>

		<published>2009-06-24T12:27:58+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=14109#p14109</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=14109#p14109"/>
		<title type="html"><![CDATA[Re: 16 byte alignment issue in vector&lt; btVector3 &gt;]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=14109#p14109"><![CDATA[
I am having a similar issue.<br><br>I am using boost::python to wrap c++ classes which use Bullet. If any class contains a btVector3 member, it will not compile, or if I try to expose btVector3 as a boost::python object.<br><br>Here's the result:<br><div class="codebox"><p>Code: </p><pre><code>C:\boost_1_38_0\boost/python/converter/as_to_python_function.hpp(21) : error C2719: 'unnamed-parameter': formal parameter with __declspec(align('16')) won't be aligned        C:\boost_1_38_0\boost/python/to_python_converter.hpp(88) : see reference to class template instantiation 'boost::python::converter::as_to_python_function&lt;T,ToPython&gt;' being compiled        with        [            T=btVector3,            [snip]</code></pre></div>I gather this is because of the btAlignmentAllocator used by btVector3. When boost::python exposes a c++ object to python it passes by value.<br>  <br>I've even tried stlport but this has no effect.<br><br>Is there anyway I can define-out the use of btAlignmentAllocator and suffer the performance penalties? Meanwhile I will try to find out how to pass-by-ref in boost::python.<br><br>Thanks<br><br>Simon<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2658">sipickles</a> — Wed Jun 24, 2009 12:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[loefje]]></name></author>
		<updated>2009-06-15T08:31:39+00:00</updated>

		<published>2009-06-15T08:31:39+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13988#p13988</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13988#p13988"/>
		<title type="html"><![CDATA[Re: 16 byte alignment issue in vector&lt; btVector3 &gt;]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13988#p13988"><![CDATA[
Hi, thanks for the answers &amp; sorry for the late reply.<br><br>loefje<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=5191">loefje</a> — Mon Jun 15, 2009 8:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2009-05-28T21:26:47+00:00</updated>

		<published>2009-05-28T21:26:47+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13749#p13749</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13749#p13749"/>
		<title type="html"><![CDATA[Re: 16 byte alignment issue in vector&lt; btVector3 &gt;]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13749#p13749"><![CDATA[
Bullet uses btAlignedObjectArray as std::vector replacement due to the buggy Microsoft STL implementation.<br><br>But if you want a more fancy and full featured stl implementation, Dirk's suggestion, <a href="http://sourceforge.net/project/showfiles.php?group_id=146814" class="postlink">STL Port</a> could do.<br>Thanks,<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Thu May 28, 2009 9:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2009-05-28T21:23:03+00:00</updated>

		<published>2009-05-28T21:23:03+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13748#p13748</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13748#p13748"/>
		<title type="html"><![CDATA[Re: 16 byte alignment issue in vector&lt; btVector3 &gt;]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13748#p13748"><![CDATA[
I think this was discussed in the forum already. The fastest workaround is using STLport instead of the Dinkumware STL implementation that ships with Visual Studio. It does not suffer from this problem.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Thu May 28, 2009 9:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[loefje]]></name></author>
		<updated>2009-05-28T10:52:17+00:00</updated>

		<published>2009-05-28T10:52:17+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13740#p13740</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13740#p13740"/>
		<title type="html"><![CDATA[16 byte alignment issue in vector&lt; btVector3 &gt;]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=13740#p13740"><![CDATA[
Hi there, <br><br>I'm having trouble creating a std::vector&lt; btVector3 &gt;, because of alignment issues,<br>even though my project settings ( MSVC2008, WinXP ) are set for 16 byte alignment..<br>Does anyone know how to get around this problem ? I'm not too familiar with structure alignment issues..<br><br>TIA,<br><br>Jochem van der Spek<br><br>Ps the error from MSVC reads:<br><br>1&gt;C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(717) : error C2719: '_Val': formal parameter with __declspec(align('16')) won't be aligned<br>1&gt;        ..\..\src\Main.cpp(684) : see reference to class template instantiation 'std::vector&lt;_Ty&gt;' being compiled<br>1&gt;        with<br>1&gt;        [<br>1&gt;            _Ty=Types::Vector3<br>1&gt;        ]<br><br>I have simply typedef'd btVector3 to my namespace Types::Vector3. which isn't the issue, <br>because this fails with std::vector&lt; btVector3 &gt; too..<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=5191">loefje</a> — Thu May 28, 2009 10:52 am</p><hr />
]]></content>
	</entry>
	</feed>
