feat: add a histrical wit-bindgen
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "smw/abort.h"
|
||||
#include "smw/wasm.h"
|
||||
|
||||
namespace smw {
|
||||
|
||||
WASM_EXPORT
|
||||
void* SMW_malloc(size_t size) {
|
||||
auto p = malloc(size);
|
||||
if (p == nullptr) {
|
||||
abort("out of memory");
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
} // namespace smw
|
||||
Reference in New Issue
Block a user