Skip to content

Instantly share code, notes, and snippets.

View nokotan's full-sized avatar

かめのこにょこにょこ nokotan

View GitHub Profile
@nokotan
nokotan / externref.cpp
Last active June 17, 2023 05:55
use externref in c code
// __externref_t is a opaque pointer that will be translated to wasm externref.
__attribute__((import_name("receive_object")))
__externref_t receive_object(void);
__attribute__((import_name("send_object")))
void send_object(__externref_t);
int main() {
send_object(receive_object());
@nokotan
nokotan / collisionDetection.c
Created February 28, 2022 06:53
JavaScript vs WebAssembly of v8 jit'ed code
#include <math.h>
struct position {
double x;
double y;
double z;
};
int collisionDetection(struct position *positions,
double *radiuses,