diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-08-26 13:48:40 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-08-26 07:48:40 -0400 |
commit | 017f88ee99b0fe40221e6af92e0b6a976fbaf2ad (patch) | |
tree | ca7b018715aca4bb7b8a71d48a2a915e63ae5b74 /core/isolate.rs | |
parent | 2235dd795d3cc6c24ff1bdd1bbdcd110b4b0bdfc (diff) |
fix: shared queue requires aligned buffer (#2816)
Diffstat (limited to 'core/isolate.rs')
-rw-r--r-- | core/isolate.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/isolate.rs b/core/isolate.rs index e0acbfd9f..a5e659c9a 100644 --- a/core/isolate.rs +++ b/core/isolate.rs @@ -785,12 +785,12 @@ pub mod tests { Mode::AsyncImmediate => { assert_eq!(control.len(), 1); assert_eq!(control[0], 42); - let buf = vec![43u8].into_boxed_slice(); + let buf = vec![43u8, 0, 0, 0].into_boxed_slice(); Op::Async(Box::new(futures::future::ok(buf))) } Mode::OverflowReqSync => { assert_eq!(control.len(), 100 * 1024 * 1024); - let buf = vec![43u8].into_boxed_slice(); + let buf = vec![43u8, 0, 0, 0].into_boxed_slice(); Op::Sync(buf) } Mode::OverflowResSync => { @@ -804,7 +804,7 @@ pub mod tests { } Mode::OverflowReqAsync => { assert_eq!(control.len(), 100 * 1024 * 1024); - let buf = vec![43u8].into_boxed_slice(); + let buf = vec![43u8, 0, 0, 0].into_boxed_slice(); Op::Async(Box::new(futures::future::ok(buf))) } Mode::OverflowResAsync => { @@ -1211,7 +1211,7 @@ pub mod tests { let control = new Uint8Array(100 * 1024 * 1024); let response = Deno.core.dispatch(99, control); assert(response instanceof Uint8Array); - assert(response.length == 1); + assert(response.length == 4); assert(response[0] == 43); assert(asyncRecv == 0); "#, @@ -1251,7 +1251,7 @@ pub mod tests { let asyncRecv = 0; Deno.core.setAsyncHandler((opId, buf) => { assert(opId == 99); - assert(buf.byteLength === 1); + assert(buf.byteLength === 4); assert(buf[0] === 43); asyncRecv++; }); |