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]
Other format: [Raw text]

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


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