STL allocators question
Gregory Martin Pfeil
pfeilgm@xmlglobal.com
Mon Jun 25 17:36:00 GMT 2001
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.
--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.5 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE7N9kXwC1urNfUT7URAg8fAKDHOT+6/FPIzrnEa1FId2qvgHUexgCfWMll
ZWUCP5XKxinFVPs6gaOTX7M=
=zt1y
-----END PGP SIGNATURE-----
More information about the Libstdc++
mailing list