Memory pool

Everything about the development of Urho3D.

Memory pool

PostPosted by sabotage3d » 16 Jun 2016, 11:25

Hi guys,
Have anyone implemented a memory pool for Urho3D? What would be the best way to approach this?
User avatar
sabotage3d
Have many posts
Have many posts
 
Posts: 515
Joined: 25 Oct 2014, 13:26

Re: Memory pool

PostPosted by hd_ » 04 Jul 2016, 23:54

Although I haven't used them, Urho has Allocator class which might be used for that.

In one project where I had many projectiles firing, I made a simple Vector<Projectile> pool, that gave a notable performance improvement.
User avatar
hd_
Contributor
Contributor
 
Posts: 220
Joined: 21 Jul 2014, 08:55
Location: Australia

Re: Memory pool

PostPosted by sabotage3d » 05 Jul 2016, 12:39

Ah cool I didn't know about that. Can it be used to create a pool for Urho3D's smart pointers and containers?
User avatar
sabotage3d
Have many posts
Have many posts
 
Posts: 515
Joined: 25 Oct 2014, 13:26

Re: Memory pool

PostPosted by Modanung » 06 Jul 2016, 09:54

sabotage3d wrote:Ah cool I didn't know about that. Can it be used to create a pool for Urho3D's smart pointers and containers?

Yes, heXon's SpawnMaster does object pooling too. Basically using a single template function.
for (Person* p : people)
ΞΞΞΞp->StopUsingWindows("https://www.linuxmint.com");
User avatar
Modanung
Active user
Active user
 
Posts: 171
Joined: 22 Jan 2015, 14:53
Location: The Netherlands


Return to Developer Talk

Who is online

Users browsing this forum: No registered users and 0 guests

cron