Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Reusing memory
PostPosted: Wed Mar 07, 2012 11:14 pm 
Offline

Joined: Sun Jan 29, 2012 10:01 pm
Posts: 49
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?


Top
 Profile  
 
 Post subject: Re: Reusing memory
PostPosted: Fri Mar 09, 2012 8:29 pm 
Offline

Joined: Mon Nov 08, 2010 2:00 am
Posts: 7
http://www.nedprod.com/programs/portable/nedmalloc/ might be worth a look, not sure if it will work with bullet though


Top
 Profile  
 
 Post subject: Re: Reusing memory
PostPosted: Fri Mar 09, 2012 10:44 pm 
Offline

Joined: Sun Jan 29, 2012 10:01 pm
Posts: 49
davidc538 wrote:
http://www.nedprod.com/programs/portable/nedmalloc/ might be worth a look, not sure if it will work with bullet though


Thanks, I wonder if it can allocate classes like the "new" and "delete" keywords.


Top
 Profile  
 
 Post subject: Re: Reusing memory
PostPosted: Fri Mar 09, 2012 11:57 pm 
Offline

Joined: Mon Nov 08, 2010 2:00 am
Posts: 7
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.


Top
 Profile  
 
 Post subject: Re: Reusing memory
PostPosted: Sat Mar 10, 2012 3:30 pm 
Offline

Joined: Sun Jan 29, 2012 10:01 pm
Posts: 49
Good, then I don't have to worry about the usual lag when 1000 objects are created at the same time.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Majestic-12 [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group