diff options
Diffstat (limited to 'core/examples')
-rw-r--r-- | core/examples/http_bench.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/examples/http_bench.rs b/core/examples/http_bench.rs index 3e02cdd46..b355f5568 100644 --- a/core/examples/http_bench.rs +++ b/core/examples/http_bench.rs @@ -111,7 +111,10 @@ fn test_record_from() { pub type HttpBenchOp = dyn Future<Item = i32, Error = std::io::Error> + Send; -fn dispatch(control: &[u8], zero_copy_buf: deno_buf) -> (bool, Box<Op>) { +fn dispatch( + control: &[u8], + zero_copy_buf: Option<PinnedBuf>, +) -> (bool, Box<Op>) { let record = Record::from(control); let is_sync = record.promise_id == 0; let http_bench_op = match record.op_id { @@ -266,8 +269,9 @@ fn op_close(rid: i32) -> Box<HttpBenchOp> { })) } -fn op_read(rid: i32, mut zero_copy_buf: deno_buf) -> Box<HttpBenchOp> { +fn op_read(rid: i32, zero_copy_buf: Option<PinnedBuf>) -> Box<HttpBenchOp> { debug!("read rid={}", rid); + let mut zero_copy_buf = zero_copy_buf.unwrap(); Box::new( futures::future::poll_fn(move || { let mut table = RESOURCE_TABLE.lock().unwrap(); @@ -285,8 +289,9 @@ fn op_read(rid: i32, mut zero_copy_buf: deno_buf) -> Box<HttpBenchOp> { ) } -fn op_write(rid: i32, zero_copy_buf: deno_buf) -> Box<HttpBenchOp> { +fn op_write(rid: i32, zero_copy_buf: Option<PinnedBuf>) -> Box<HttpBenchOp> { debug!("write rid={}", rid); + let zero_copy_buf = zero_copy_buf.unwrap(); Box::new( futures::future::poll_fn(move || { let mut table = RESOURCE_TABLE.lock().unwrap(); |