Giter VIP home page Giter VIP logo

Comments (4)

Hywan avatar Hywan commented on July 17, 2024

Hello,

The same way you export a malloc and a setImage functions, you should also export a free function. Check the greet example (the greet.rs file and the greet.py file).

from wasmer-python.

joker512-tmp avatar joker512-tmp commented on July 17, 2024

The thing here is that I don't explicitly import "malloc", but it's presented. My compilation commands looks like this:
emcc -O2 src/Graph.cpp src/Selection.cpp -o core.wasm -s EXPORTED_FUNCTIONS='["_setImage", "_getMask", "_updateSelection"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' -s TOTAL_MEMORY=268435456
So, no "malloc" in "EXPORTED_FUNCTIONS". And when you use wasm from JS both "malloc" and "free" functions are presented.

The easy solution is just to make wrapper for "free" function and call it inside, but it looks like both have to be supported by default.

from wasmer-python.

Hywan avatar Hywan commented on July 17, 2024

Personally, I would open an issue on emscripten to understand why free isn't exported by default. If malloc is, it is correct to assume free should be exported too.

from wasmer-python.

Hywan avatar Hywan commented on July 17, 2024

Closing as it's not related to this package itself.

Please feel free to raise your voice if you need further help, or if you believe this project is responsible of addressing this issue.

Thanks!

from wasmer-python.

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.