Boost logo

Boost :

From: Gregory Colvin (gregory.colvin_at_[hidden])
Date: 2003-08-31 15:06:44


On Sunday, Aug 31, 2003, at 13:51 America/Denver, Peter Dimov wrote:

> Gregory Colvin wrote:
>
> [...]
>
> Two small corrections:
>
>> shared_ptr currently uses std::allocator to allocate counts
>> regardless.
>
> No, it uses plain new/delete by default. It is possible to get it to
> use
> std::allocator via a #define.

OK. Anyway, the std::allocator interface is adequate for shared_ptr.

> [...]
>
>> versus standard Allocator
>>
>> Allocator::pointer p = allocator.allocate(sizeof T);
>> allocator.construct(p,T());
>> ...
>> allocator.destroy(p);
>> allocator.deallocate(sizeof T);
>
> allocate(1) and deallocate(p, 1) if I'm not mistaken.

You are not. I shouldn't post uncompiled code late at night.


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