Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2000-03-07 13:49:49


From: Nicolai Josuttis <nicolai.josuttis_at_[hidden]>
>
> Questions:
>
> o Shouldn't auto_array be provided (for completeness) ?

Perhaps. I haven't cared enough to wrtie one, but if anyone else
does that's good.

> o The decision was made to use a direct detached implementation
> technique. To cite the text:
> "We went so far as to run various timings of the direct and indirect
> approaches, and found
> that at least on Intel Pentium chips there was very little measurable
> difference."
> However, the smart pointer tests give a totally different view. Following them
> using a direct detached implementation is a significant penalty.
> So, why do we still use the direct detached implementation technique?

The only other workable implementation technique is linked_ptr,
which has it's own performance tradeoffs. I think the upshot
of the testing was that the main impediment to shared_ptr
performance was operator new(), and that a faster allocator
gave much better results. People are working on such an
allocator now, and I plan to incorporate it in the next release
of shared_ptr.

> o I wonder, whether it would be useful to parametrize the release operation,
> at least for scoped_ptr and scoped_array.
> Couldn't we implement a template for two types, the element type and the
> release operation. This would allow to use the "resource acquisition is
> initialization" idiom with other acquisitions than new and new[].

Yes, we have discussed this before and it is on my to-do list.
Unfortunately I am very busy with my main job these days and
am not making much progress on that list.

> Attached is an example implementation.

Thanks.


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