I want to use static memory and recycled dynamic memory with at least 64 objects per allocation.
I tried to use the C API but it did not let me allocate the memory myself for some reason.
I started with the C++ API and tried calling the contructor and destructor methods directly in the class btRigidBody but that did not work either.
I tried using class inheritance to add a reuse method to btRigidBody but the class have no default constructor to inherit.
How can I recycle memory with bullet?
Reusing memory
-
- Posts: 7
- Joined: Mon Nov 08, 2010 2:00 am
Re: Reusing memory
http://www.nedprod.com/programs/portable/nedmalloc/ might be worth a look, not sure if it will work with bullet though
-
- Posts: 49
- Joined: Sun Jan 29, 2012 10:01 pm
Re: Reusing memory
Thanks, I wonder if it can allocate classes like the "new" and "delete" keywords.davidc538 wrote:http://www.nedprod.com/programs/portable/nedmalloc/ might be worth a look, not sure if it will work with bullet though
-
- Posts: 7
- Joined: Mon Nov 08, 2010 2:00 am
Re: Reusing memory
it uses a memory pool and is a low level replacement for windows allocators (so yes it works with new and delete), apparently its quite an improvement too although i think bullet uses something like this already, worth a look though.
-
- Posts: 49
- Joined: Sun Jan 29, 2012 10:01 pm
Re: Reusing memory
Good, then I don't have to worry about the usual lag when 1000 objects are created at the same time.