Skip to content

Commit bec0521

Browse files
committed
Explain why taking wasmImports, wasmExports, and syscalls collections
1 parent b9ec6b9 commit bec0521

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/php-wasm/universal/src/lib/os-user-space.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,23 @@ export type OSUserSpaceContext = {
6464
HEAPU64: BigUint64Array;
6565
HEAPF64: Float64Array;
6666
};
67+
// This is a collection of functions present in built php-wasm JS.
68+
// By receiving the entire collection here, we can avoid recompiling
69+
// php-wasm JS whenever we add a new dependency from this collection.
6770
wasmImports: {
6871
builtin_fcntl64: (fd: number, cmd: number, varargs?: any) => number;
6972
builtin_fd_close: (fd: number) => number;
7073
js_wasm_trace: (...args: any[]) => void;
7174
};
75+
// This is a collection of functions present in built php-wasm JS.
76+
// By receiving the entire collection here, we can avoid recompiling
77+
// php-wasm JS whenever we add a new dependency from this collection.
7278
wasmExports: {
7379
wasm_get_end_offset: (fd: number) => bigint;
7480
};
81+
// This is a collection of functions present in built php-wasm JS.
82+
// By receiving the entire collection here, we can avoid recompiling
83+
// php-wasm JS whenever we add a new dependency from this collection.
7584
syscalls: {
7685
getStreamFromFD: (fd: number) => Emscripten.FS.FSStream;
7786
};

0 commit comments

Comments
 (0)