
On Thu, 13 Aug 2009 08:01:24 -0700, Jason Dictos <jdictos@barracuda.com> wrote:
Essentially what we want to do is have a heap ptr class that can be copied around easily, without incurring the continual cost of duplicating the heap space on each copy operation. [...] Really almost exactly like an STL string (Assuming COW was being used of course), except it would hold binary safe data.
References won't help in your case? I may also point you to pool_allocator in boost, that's going to reduce very much the cost of allocating and deallocating objects. Someone in the mailing list pointed out quite correctly that COW is not a very good idea on a 2009 system. I think in one of Sutter's book the COW is benchmarked and it's slower than non-COW. As for memory usage reduction, pool allocation is better suited. -- EA