Boost logo

Boost :

Subject: Re: [boost] [root_ptr] Deterministic Javascript-like memory manager
From: Phil Bouchard (philippeb8_at_[hidden])
Date: 2017-07-09 23:07:48


On 07/09/2017 02:30 PM, Phil Bouchard via Boost wrote:
>
> int main()
> {
> cout << "Scope 0: BEGIN" << endl;
> {
> node_proxy x; // 1st proxy
> node_ptr<A> a1 = make_node<A>(x, x, "a1");
>
> cout << "Scope 1: BEGIN" << endl;
> {
> node_proxy x; // 2nd proxy
> node_ptr<A> b1 = make_node<A>(x, x, "b1");
> node_ptr<A> b2 = make_node<A>(x, x, "b2");
>
> a1 = b1; // upscale scope of b1 to use 1st proxy
>
> b1 = make_node<A>(x, x, "b3"); // scope of b1 will still be
> associated with the 1st proxy
> b1->i = b1; // cycle
> }
> cout << "Scope 1: END" << endl;
> }
> cout << "Scope 0: END" << endl;
> }
>
>
> Will output:
>
> Scope 0: BEGIN
> A::A(const boost::node_proxy&, const char*): a1
> Scope 1: BEGIN
> A::A(const boost::node_proxy&, const char*): b1
> A::A(const boost::node_proxy&, const char*): b2
> A::~A(): a1
> A::A(const boost::node_proxy&, const char*): b3
> A::~A(): b2
> Scope 1: END
> A::~A(): b1
> A::~A(): b3
> Scope 0: END

Verdict: I will dissociate root_ptr from Boost and include it in Qt.

I am not sure where the whole Boost memory management crew went over the
years but the underlying integration with Javascript is the way to go.
But thanks Boost for your support over the years.

Sincerely,
-Phil


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