Boost logo

Boost :

From: Philippe A. Bouchard (philippeb_at_[hidden])
Date: 2003-01-31 20:04:29


"Larry Evans" <jcampbell3_at_[hidden]> wrote in message
news:3E399832.1020709_at_prodigy.net...
> Philippe A. Bouchard wrote:
>
> [snip]
> >
> > I guess it would also be possible to allocate a "shifted object" into
some
> > specific memory page, so operator delete will be able to quickly detect
> > weither the object is shifted or not. This way it would be possible to
> > overload the main operator new.
> >
>
> I think this is what BW does to distinguish between pointers produced by
> GC_malloc_uncollectable and gc_malloc. Also, I think cmm does something
> similar (see ftp://ftp.di.unipi.it/pub/Papers/attardi/SPE.ps.gz ).

Yeah, this is exactly how it works. It can create different heaps and the
pointer can be identified quickly to which heap it belongs. Their example
uses placement operator new also. In fact, if you want to share any pointer
generated by any placement new between any smart pointer, this would be the
best way IMO. Some BOOST_DISPLACE_NEW_GC macro could be defined to displace
the main operator new also.

Philippe A. Bouchard


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