Boost logo

Boost :

Subject: Re: [boost] [xint] Boost.Move vs Copy-on-Write timings
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2010-05-04 14:10:56


Le 04/05/2010 16:41, Chad Nelson a écrit :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 05/04/2010 06:16 AM, Mathias Gaunard wrote:
>
>>> Exactly what I was saying -- operator+ and operator- are the only ones
>>> where it would be likely to save any allocations. The results from
>>> operator*, for example, will be larger than the bit-length of the
>>> largest parameter.
>>
>> I take [it] you don't support in-place expansion then.
>> A shame.
>
> I wasn't aware that it was possible to use in-place expansion when
> allocating memory via new.

You allocate the memory with new? That severely restricts the library.
You should use allocators.

There are nice extensions to standard allocators that Ion Gaztañaga has
made that allow two-way in-place expansion and shrinking.
<http://www.drivehq.com/web/igaztanaga/allocplus/>

I would have loved to see that in that kind of project, but of course,
that's no more than a wish of mine.


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