This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

STL allocators question


On my current project, I use __USE_MALLOC when I make debug builds.
Since the effect of this (as I understand it) is to use the
malloc_alloc allocator in place of any of the other allocators in the
STL, I was wondering if it might be possible to do the same sort of
thing for the other allocators.

Something like __USE_PTHREAD_ALLOC, effectively making that allocator
the default in place of alloc.

The reason I would like to do this is to run some benchmarks with the
entire project using pthread_alloc, seeing if it gives us a speedup.

I know the way it works isn't quite the same as setting it as the
"default" allocator, as __USE_MALLOC prevents you from using alloc
anywhere, even explicitly. However, something akin to __USE_MALLOC
would suit my purposes just fine.

To get to the point . . . is there any such mechanism? Also, what are
the arguments for/against being able to set an allocator other than
alloc as the default?

Thanks.

PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]