This gist is part of my article “Emscripten’s embind”.
Build it with
$ emcc -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' -O3 nobind.cpp
or
$ docker run --rm -v $(pwd):/src trzeci/emscripten emcc -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' -O3 nobind.cpp
License Apache-2.0
@surma Thank you for sharing the example. Your blogs related to WebAssembly are useful and knowledgeable.
Related to this example, I have one doubt.
In file
nobind.html
, and in functionexclaim(str)
, memory pointed byp
andp2
should be freed after the usage. Otherwise, there will be memory leak. Is that correct ?