Skip to content
Permalink
Browse files

clean up

  • Loading branch information...
ry committed Mar 15, 2019
1 parent b1586b7 commit b7621059b9e0e2b195f80049cf7d73b36601d8dd
Showing with 5 additions and 5 deletions.
  1. +1 −1 core/http_bench.js
  2. +4 −4 core/isolate.rs
@@ -65,7 +65,7 @@ function sendAsync(opId, arg, zeroCopy = null) {

function recordFromBuf(buf) {
assert(buf.byteLength === 16);
const buf32 = new Int32Array(buf.buffer, buf.byteOffset, buf.byteLength);
const buf32 = new Int32Array(buf.buffer, buf.byteOffset, buf.byteLength / 4);
return {
promiseId: buf32[0],
opId: buf32[1],
@@ -351,31 +351,31 @@ impl<B: Behavior> Future for Isolate<B> {
assert_eq!(self.shared.size(), 0);

let mut i = 0;
while i != self.pending_ops.len() {
while i < self.pending_ops.len() {
let pending = &mut self.pending_ops[i];
match pending.poll() {
Err(()) => panic!("unexpected error"),
Ok(Async::NotReady) => {
i += 1;
}
Ok(Async::Ready(record)) => {
Ok(Async::Ready(buf)) => {
let completed = self.pending_ops.remove(i);
completed_count += 1;

if completed.zero_copy_id > 0 {
self.zero_copy_release(completed.zero_copy_id);
}

self.shared.push(record);
self.shared.push(buf);
}
}
}

if completed_count > 0 {
self.respond()?;
// The other side should have shifted off all the messages.
assert_eq!(self.shared.size(), 0);
self.shared.reset();
// assert_eq!(self.shared.size(), 0);
}
}

0 comments on commit b762105

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.