Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-02-11 16:19:16


Trey Jackson <tjackson_at_[hidden]> writes:

> All,
>
> I'm loving the shared_ptr class,
> however we have one issue that doesn't seem to be addressed by any of
> boost's smart pointers, and I'm looking for a work-around/alternative.
> Any help?
>
> The issue is that the smart pointers assume the pointer type to be
> 'T*', which is fine on a 32-bit system, but means that we get a near
> doubling of run-time size on our application when we move to a 64-bit
> application.
>
> As a result, we're using the standard technique to have a custom heap,
> and use our own 'pointers' into that heap that are smaller (typically
> 32-bits).
>
> But of course our ClassOnHeapPtr type does not match a 'ClassOnHeap *',
> so a boost::shared_ptr<ClassOnHeap> won't work.
>
>
> Are there any other libraries you boosters would recommend?

You might look at the policy-based smart_ptr implementation in the
Boost sandbox. Maybe you could devise an appropriate policy for
holding your "small pointer".

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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