Comments (4)
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.
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.
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.
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)
- Error print?
- Is wasmer-python avaliable for ubuntu 20.04, x86_64 ?
- Failt to execute TiDB
- Error print the result?
- Register allocation error
- Fail to load the module?
- wasi Runtime error?
- No error report?
- RuntimeError: RuntimeError: val is not reference HOT 1
- The Windows is not supported by wasmer-python?
- How to set the pre-open directory when perform wasi program?
- Wasmer-python doesn't support multiple wasi versions.
- `RuntimeError: RuntimeError: WASI exited with code: 0`
- The stuck occurs during execution.
- Provide abi3 Wheels HOT 1
- Publishing fake versions is confusing
- Use maturin container (or even action) for manylinux builds HOT 1
- Embed packages example on website doesn't work.
- When do you plan to release version 1.1.1 to pypi? HOT 6
- Broken on Python 3.12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasmer-python.