This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Good numbers from Ritter's new string allocator
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: rittle at latour dot rsch dot comm dot mot dot com
- Date: Thu, 22 Nov 2001 12:08:35 -0800 (PST)
- Subject: Re: Good numbers from Ritter's new string allocator
It's looking like this should go in. Nathan, thoughts?
There is a bunch of stuff in std::string::_Rep to do with allocations. Is it
supposed to handle this kind of tuning gracefully? If so, how? It seems
obvious to me that the default allocation strategy is way off, and should
be fixed.
In particular:
#if _GLIBCPP_ALLOC_CONTROL
// These function pointers allow you to modify the allocation
// policy used by the string classes. By default they expand by
// powers of two, but this may be excessive for space-critical
// applications.
// Returns true if ALLOCATED is too much larger than LENGTH
static bool (*_S_excess_slop) (size_t __length, size_t __allocated);
inline static bool
__default_excess(size_t, size_t);
#else
inline static bool
_S_excess_slop(size_t, size_t);
#endif
-benjamin