Boost logo

Boost :

From: Philippe A. Bouchard (philippeb_at_[hidden])
Date: 2002-07-28 19:20:44


"Gennadiy Rozental" <rogeeff_at_[hidden]> wrote in message
news:ai1ujf$ngu$1_at_main.gmane.org...
> > We do you think about those different possibilities:
> > 1) new type();
> > 2) new (xmm) type();
> > 3) make_rc(type());
> > 4) make_rc(new (xmm) type());
> > 5) new (new (xmm) type()) rc<type>;
>
> Are you kidding me??!! Can't you explain without SINGLE C++ statement,
what
> is your idea and why it could not be implemented the conventional way and
> without overridding any operators new?

Don't you have an idea of what is going on in the backstage here?!? Again,
my main goal is to add 1 integer length when the object is allocated; one
malloc call not two (for counters); copying is faster when
sizeof(shared_ptr<type>) == sizeof(type *); no need for policy based
functions in your class to handle reference counts; works with typenames
like: int, float, char *, char (*)(), char (* volatile const)(int, float,
double (*)(int, long, double), char (*) [10][20][30], ...); the integer
(counter) can be replaced by a virtual table, size_t, etc.; thus is more
extensible for memory management or dynamic information. It is impossible
to do so with the current standards or policies easily in an efficient way
because I _have_ to modify the operator new when objects are allocated, not
after. It will be too late for performance gains.

Thank you.

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