Giter Site home page Giter Site logo

Comments (3)

badboy avatar badboy commented on July 17, 2024 1

A new example showing how to actual use the memory could be interesting for sure.
We have to be careful though, mixing two allocators (one on each side) will most likely lead to problems, so we have several possibilities:

  1. Have the same allocator on both sides
  2. Have just one allocator and the other side has to call into it (as we currently do with the allocator in Rust)
  3. Don't allocate on the Rust side, then we can just put stuff into memory once and Rust can use it

For the example I can go with option 3 for now.

from hellorust.

daniel-abramov avatar daniel-abramov commented on July 17, 2024

Sounds good!

By option (3) you basically mean the creation of the Memory object and using it for storing objects, and then passing pointers to it (indexes) to the Rust code, right?

BTW, I'm not even sure if the option (1) is possible at the moment. Most likely the allocators will differ.

from hellorust.

badboy avatar badboy commented on July 17, 2024

Regarding (3): Yup, just put in some data, pass it as a pointer and let Rust construct the object, but not deallocate anything.

Option (1) is surely possible as long as both sides are absolutely identical (then again a minimal dumb allocator is not too hard to write, I do have such an example around as well)

from hellorust.

Related Issues (13)

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.