Giter Site home page Giter Site logo

Comments (2)

cyrush avatar cyrush commented on August 27, 2024 1

@xjrc @bryujin

Pondering this a bit more. It's tricky:

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();






from conduit.

cyrush avatar cyrush commented on August 27, 2024

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.

from conduit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.