summaryrefslogtreecommitdiff
path: root/ext/flash/lib.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-08-21 17:37:53 +0530
committerGitHub <noreply@github.com>2022-08-21 17:37:53 +0530
commit906aa78af33c8405a47d5446d2a6fb3348c275bb (patch)
treec444e42b6bdfe4bad35634925829a1b1d190fa75 /ext/flash/lib.rs
parente39d4e3e7fb9815bf094e7321d1d73d00275831a (diff)
feat(ops): V8 Fast Calls (#15291)
Diffstat (limited to 'ext/flash/lib.rs')
-rw-r--r--ext/flash/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/flash/lib.rs b/ext/flash/lib.rs
index abd8502d0..92350db58 100644
--- a/ext/flash/lib.rs
+++ b/ext/flash/lib.rs
@@ -1344,8 +1344,8 @@ async fn op_flash_next_async(
// the ContextScope creation is optimized away and the op is as simple as:
// f(info: *const v8::FunctionCallbackInfo) { let rv = ...; rv.set_uint32(op_flash_next()); }
#[op]
-fn op_flash_next(op_state: &mut OpState) -> u32 {
- let flash_ctx = op_state.borrow_mut::<FlashContext>();
+fn op_flash_next(state: &mut OpState) -> u32 {
+ let flash_ctx = state.borrow_mut::<FlashContext>();
let ctx = flash_ctx.servers.get_mut(&0).unwrap();
next_request_sync(ctx)
}
@@ -1353,8 +1353,8 @@ fn op_flash_next(op_state: &mut OpState) -> u32 {
// Syncrhonous version of op_flash_next_async. Under heavy load,
// this can collect buffered requests from rx channel and return tokens in a single batch.
#[op]
-fn op_flash_next_server(op_state: &mut OpState, server_id: u32) -> u32 {
- let flash_ctx = op_state.borrow_mut::<FlashContext>();
+fn op_flash_next_server(state: &mut OpState, server_id: u32) -> u32 {
+ let flash_ctx = state.borrow_mut::<FlashContext>();
let ctx = flash_ctx.servers.get_mut(&server_id).unwrap();
next_request_sync(ctx)
}