Boost logo

Boost :

Subject: Re: [boost] [cpo-proposal] presentation of the idea
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-09-10 05:50:40


On Tue, Sep 10, 2013 at 1:15 PM, Santiago Tapia <santiago.tapia_at_[hidden]>wrote:

> > Date: Mon, 09 Sep 2013 11:57:43 -0500
> > From: Larry Evans <cppljevans_at_[hidden]>
> >
> >> But because I am not an expert on alignment and memory
> >> optimization, I will try to use something "more standard", actually I am
> >> going trying to use the allocator to compute the "right" address to
> place
> >> an object of a given type that is greater that a "free" memory pointer.
> >> In that way, I also expect to take advantages of allocator such as
> >> tbb cache aligned allocator.
> >
> > I know nothing about how 'to use the allocator to compute the "right"
> > address'; hence, I'm afraid I can't be any help there. Could you maybe
> > give a brief summary of how that works?
> >
>
> No idea, I was just speculating, actually, I am not sure I will be able to
> do it. On the other hand, I suppose there should be a way to do it.
> Just need some time and thought.
>

Allocator itself is not suitable for determining object address. Its
interface is tailored for allocating objects and arrays of objects of the
same type. If you want something more elaborate, you have to implement it
yourself, I'm afraid.

I might add that you're treading on the memory management field. This can
be a rather complicated matter, which deserves a dedicated library, IMHO.
Things like efficient (both in terms of space and time) allocation
strategies and dealing with fragmentation are point of a serious research,
which is in most part beyond a container library. The container should
allocate memory in the way most suitable for the intended use of the
container. It is the allocator's job to perform these allocations
efficiently. So, my advice would be to focus on the container interface
design first.


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