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
x 1

Add "allocator" parameter for STL

Post by ven »

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.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Add "allocator" parameter for STL

Post by jacmoe »

Unless I've misunderstood it all, we already have that:
http://www.ogre3d.org/forums/viewtopic.php?f=4&t=46951
/* 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
x 1

Re: Add "allocator" parameter for STL

Post by ven »

Yes, that's exactly what I mean.
Sorry for the repeat.
Post Reply