Implement reference counting (#592)

This commit is contained in:
Daniel Wirtz
2019-06-05 23:15:39 +02:00
committed by GitHub
parent 3ed76a97f0
commit 0484a6b740
601 changed files with 261645 additions and 146131 deletions

View File

@@ -1,7 +1,5 @@
import { dirent, rwevent, fdstat, filestat, iovec, clocksubscription, fdsubscription, signal, dirprestat } from "bindings/wasi";
const WASM32 = 1;
const WASM64 = 2;
import { Target } from "shared/target";
assert(offsetof<dirent>("next") == 0);
assert(offsetof<dirent>("ino") == 8);
@@ -33,10 +31,10 @@ assert(offsetof<filestat>("ctim") == 48);
assert(offsetof<filestat>() == 56);
assert(offsetof<iovec>("buf") == 0);
if (ASC_TARGET == WASM32) {
if (ASC_TARGET == Target.WASM32) {
assert(offsetof<iovec>("buf_len") == 4);
assert(offsetof<iovec>() == 8);
} else if (ASC_TARGET == WASM64) {
} else if (ASC_TARGET == Target.WASM64) {
assert(offsetof<iovec>("buf_len") == 8);
assert(offsetof<iovec>() == 16);
} else {
@@ -58,10 +56,10 @@ assert(offsetof<fdsubscription>("fd") == 16);
assert(offsetof<fdsubscription>() == 20);
assert(offsetof<dirprestat>("type") == 0);
if (ASC_TARGET == WASM32) {
if (ASC_TARGET == Target.WASM32) {
assert(offsetof<dirprestat>("name_len") == 4);
assert(offsetof<dirprestat>() == 8);
} else if (ASC_TARGET == WASM64) {
} else if (ASC_TARGET == Target.WASM64) {
assert(offsetof<dirprestat>("name_len") == 8);
assert(offsetof<dirprestat>() == 16);
} else {