WebAssembly编译出来的.wasm文件js如何调用
c代码char* toChar (char* str) { return str;}int add (int x, int y) { return x + y;}int square (int x) { return x * x;}然后执行emcc hello.c -Os -s WASM=1 -s SIDE_MODULE=1 -o hello.wasm编译出wasm文件新建hello.html加入调用的方法如下:<!DOCTYPE html>
原创
2020-06-10 16:20:31 ·
4908 阅读 ·
2 评论