• 2022-10-13WebAssembly01-- 在js中分配内存
    编译选项emccsum.cc-osum.js-sEXPORTED_FUNCTIONS=_malloc,_freesum.cc#include"util.h"#include<stdlib.h>#include<string.h>#include<malloc.h>EM_PORT_AP
  • 2022-10-12WebAssembly01--util.h
    内容简要请使用者自行优化#ifndefEM_PORT_API# ifdefined(__EMSCRIPTEN__)# include<emscripten.h># ifdefined(__cplusplus)# defineEM_PORT_API(rettype)
  • 2022-10-12WebAssembly01--c代码调用js
    编译选项emcctest.c--js-librarypkg.js-otest.jspkg.jsmergeInto(LibraryManager.library,{js_add:function(a,b){console.log("js_add");