Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2002-09-04 09:56:08


From: Carlo Wood <carlo_at_[hidden]>
> On Tue, Sep 03, 2002 at 01:03:07PM -0400, Rob Stewart wrote:
[snip description of preallocating allocator ;-)]
> > > Actually, I think that allocators like this should
> > > be part of boost too, and NOT as a part of my demangler
> > > library, but provided seperately.
> >
> > That is certainly a valid point. Of course, you could implement it first within
>
> Well, from this is shows that you DO understand what we're talking about.
> *confused*

Sorry to confuse you. Once again, I was acknowledging your requirement for an
allocator for your internal use, so I was explaining how that might be done.
That doesn't mean I'm convinced that an allocator must be part of the
interface.

> Anyway - if I'd add an allocator to the library that does pre-allocation,
> then (for the case that I need it) would need to call __libc_malloc in it,

I don't know what __libc_malloc is, so this doesn't help me. I presume it is
some library internal, non-portable, implementation function for malloc(). I
don't understand why you must call it. If your STL code uses an allocator, then
it can use the one I discussed (the one that preallocates its memory), so there
is no call to new and no call to malloc(). What is it you're trying to tell me
that I still don't understand?

> which is not portable. I am not going to explain why. I WOULD implement
> the library as one that allows the user to pass an Allocator type though,
> and then seperately provide an allocator and a "wrapper". But - I am not
> going to do that. The category of users that is not capable of writing

I appreciate your candor. That you are willing to write the demangling code is,
itself, valuable.

> going to do that. The category of users that is not capable of writing
> an allocator will not need on imho, they can use std::allocator.

This may be a reasonable point, but it's not clear to me in which situations
a demangle() client should create an allocator. Therefore, I can't determine
its validity.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk