This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Allocator in basic_string should default to __STL_DEFAULT_ALLOCATOR(charT)
- From: Lars Doelle <lars dot doelle at on-line dot de>
- To: libstdc++ at gcc dot gnu dot org,gcc-patches at gcc dot gnu dot org
- Date: Fri, 27 Sep 2002 04:57:57 +0200
- Subject: PATCH: Allocator in basic_string should default to __STL_DEFAULT_ALLOCATOR(charT)
Hi,
please consider the attached patch for inclusion in libstdc++.
To check for memory leaks, i'm using the hooks in malloc/realloc/free counting
object allocation and deallocation. To this end, i use
#define __STL_DEFAULT_ALLOCATOR(T) malloc_alloc
so that all (de,re)allocations path through malloc/realloc/free.
But basic_string does not respect this macro, and from the style of the stl, i
find this an omission or inconsistency.
In case i picked the wrong mean to make all of the stl use only malloc_alloc,
please let me know.
Best regards,
- lars
--- bastring.h.old 2002-09-24 15:47:43.000000000 +0200
+++ bastring.h 2002-09-24 15:47:16.000000000 +0200
@@ -62,7 +62,7 @@
#endif
template <class charT, class traits = string_char_traits<charT>,
- class Allocator = alloc >
+ class Allocator = __STL_DEFAULT_ALLOCATOR(charT) >
class basic_string
{
private: