diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-08-14 19:54:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-14 19:54:35 -0400 |
commit | 498f6ad431478f655b136782093e19e29248b24d (patch) | |
tree | f1a39982a1a372422ea93b1c9bd7298fe9a1e838 /js/dispatch_minimal.ts | |
parent | e6c349af9f7260c2c4ec713bd231fe554240721e (diff) |
Remove dead code: legacy read/write ops (#2776)
readSync and writeSync use dispatch_minimal now.
Diffstat (limited to 'js/dispatch_minimal.ts')
-rw-r--r-- | js/dispatch_minimal.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/dispatch_minimal.ts b/js/dispatch_minimal.ts index df0a290b2..483342127 100644 --- a/js/dispatch_minimal.ts +++ b/js/dispatch_minimal.ts @@ -52,6 +52,19 @@ export function handleAsyncMsgFromRustMinimal( promise!.resolve(result); } +export function sendSyncMinimal( + opId: number, + arg: number, + zeroCopy: Uint8Array +): number { + scratch32[0] = 0; // promiseId 0 indicates sync + scratch32[1] = arg; + const res = core.dispatch(opId, scratchBytes, zeroCopy)!; + const res32 = new Int32Array(res.buffer, res.byteOffset, 3); + const resRecord = recordFromBufMinimal(opId, res32); + return resRecord.result; +} + export function sendAsyncMinimal( opId: number, arg: number, |