From becbb56b19e96e4dd72b861217a855fba953d290 Mon Sep 17 00:00:00 2001 From: Valentin Anger Date: Mon, 1 Jun 2020 20:20:47 +0200 Subject: feat(core): Ops can take several zero copy buffers (#4788) --- core/examples/http_bench.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/examples/http_bench.js') diff --git a/core/examples/http_bench.js b/core/examples/http_bench.js index d9878cbe7..a893dab40 100644 --- a/core/examples/http_bench.js +++ b/core/examples/http_bench.js @@ -36,18 +36,18 @@ const scratchBytes = new Uint8Array( ); assert(scratchBytes.byteLength === 3 * 4); -function send(promiseId, opId, rid, zeroCopy = null) { +function send(promiseId, opId, rid, ...zeroCopy) { scratch32[0] = promiseId; scratch32[1] = rid; scratch32[2] = -1; - return Deno.core.dispatch(opId, scratchBytes, zeroCopy); + return Deno.core.dispatch(opId, scratchBytes, ...zeroCopy); } /** Returns Promise */ -function sendAsync(opId, rid, zeroCopy = null) { +function sendAsync(opId, rid, ...zeroCopy) { const promiseId = nextPromiseId++; const p = createResolvable(); - const buf = send(promiseId, opId, rid, zeroCopy); + const buf = send(promiseId, opId, rid, ...zeroCopy); if (buf) { const record = recordFromBuf(buf); // Sync result. -- cgit v1.2.3