Add "allocator" parameter for STL

What it says on the tin: a place to discuss proposed new features.
Post Reply
ven
Kobold
Posts: 35
Joined: Mon Sep 10, 2007 11:03 am
Location: St. Petersburg, Russia

Add "allocator" parameter for STL

Post by ven » Mon Feb 09, 2009 5:58 am

Ogre allows replace allocators for allocate objects (using new and delete), but does not allows replace the allocators for stl containers (like stl::vector, stl::string, std::ostringstream ;) ) that are also necessary.

All you have to do - it is added to all typedef stl containers "allocator" parameter, like

Code: Select all

typedef std::vector<SubMesh*, allocator<SubMesh*> > SubMeshList;
// instead
typedef std::vector<SubMesh*> SubMeshList;
and set in OgreConfig.h

Code: Select all

typedef std::allocator allocator;
This change does not affect users, but increases flexibility. This allows use of efficient allocators everywhere.
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Add "allocator" parameter for STL

Post by jacmoe » Mon Feb 09, 2009 11:39 am

Unless I've misunderstood it all, we already have that:
http://www.ogre3d.org/forums/viewtopic.php?f=4&t=46951
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

ven
Kobold
Posts: 35
Joined: Mon Sep 10, 2007 11:03 am
Location: St. Petersburg, Russia

Re: Add "allocator" parameter for STL

Post by ven » Mon Feb 09, 2009 7:46 pm

Yes, that's exactly what I mean.
Sorry for the repeat.
0 x

Post Reply