You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node n;
n["a/b/c/d/e/f"].set_int32(10);
n["a/b/c/d/e/g"].set_int32(11);
// in n f + g own data
Node n2;
n.compact_to(n2);
// in n2 root owns data
int32 *f_ptr = n2["a/b/c/d/e/f"].element_ptr()
int32 *g_ptr = n2["a/b/c/d/e/g"].element_ptr()
// these would be no-ops, which is fine:
n2["a/b/c/d/e/f"].release_ownership();
n2["a/b/c/d/e/g"].release_ownership();
// however:
Node n3;
n3["f"].set_external(f_ptr);
n3["g"].set_external(g_ptr);
// this would be very dangerous:
n3["f"].take_ownership();
n3["g"].take_ownership();
we have pondered this quite a bit -- don't think there is a safe way to provide this.
If someone asks again, we can revisit -- but for many use cases it hasn't come up.
converting from external to owned, and vice versa.
We tried to attack this before, had a hard time with finding the right names.
The text was updated successfully, but these errors were encountered: