1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <assert.h> #include <emscripten.h> extern "C" { void one(char *data, int size) { int *x = (int*)data; int num = size/sizeof(int); for (int i = 0; i < num; i++) { x[i] += 1234; } emscripten_worker_respond(data, size); } }