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: Less good ;-) results from Rittle's string allocator


On Fri, Nov 30, 2001 at 12:11:30PM -0400, Brad Spencer wrote:
> > Even if the off-the-cuff idea above were implemented -- and it /is/ ugly
> > as sin :-) -- we couldn't recommend that users make use of names in the
> > implementation namespace.  They'd have to be wrapped and exposed somehow.
> 
> Perhaps in ext?

Oh, definitely in the ext directory.  But we also need to choose a
namespace, and type names inside that namespace, and then maintain them.
(Although perhaps we don't need to be as careful about maintain extensions
as we must be about maintaining the standard ABI.)

The only drawback to putting extensions in namespace __gnu_cxx is that it
/also/ has the leading-underscore name, and thus screams "stay away" to
smart programmers.  :-)  Maybe "namespace gnu_ext" or "namespace gnu_ext
= __gnu_cxx".


> Sorry, I confused things with poor wording, there.  What I meant to
> say was that I don't really care about alignment (8-byte is fine), but
> what I might want to tweak is the number of freelists (which is
> computed from the _ALIGN and _MAX_BYTES).  For example, I might want
> to set _MAX_BYTES to 1024, but that would give 1024 / 8 = 128 separate
> free lists, which, as far as I can tell, represent pools of size 8,
> 16, 24, 32, ..., 1024.  If I was using a custom allocator, I might
> know that I would only want, say, sizes of 128, 256, 384, ..., 1024,
> so I'd only need 8 free lists.  The rest would never be touched.

Ah.  Good point, that.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams


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