From 38555a6a0fe9a7235776afe0ebfb2a24dc518391 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 3 Mar 2023 19:04:10 +0530 Subject: feat(ops): reland fast zero copy string arguments (#17996) Reland https://github.com/denoland/deno/pull/16777 The codegen is disabled in async ops and when fallback to slow call is possible (return type is a Result) to avoid hitting this V8 bug: https://github.com/denoland/deno/issues/17159 --- core/ops_builtin.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs index 1cc1e8d34..d225b8624 100644 --- a/core/ops_builtin.rs +++ b/core/ops_builtin.rs @@ -108,7 +108,7 @@ pub fn op_metrics(state: &mut OpState) -> (OpMetrics, Vec) { /// Builtin utility to print to stdout/stderr #[op] -pub fn op_print(msg: String, is_err: bool) -> Result<(), Error> { +pub fn op_print(msg: &str, is_err: bool) -> Result<(), Error> { if is_err { stderr().write_all(msg.as_bytes())?; stderr().flush().unwrap(); @@ -153,12 +153,12 @@ pub fn op_wasm_streaming_feed( pub fn op_wasm_streaming_set_url( state: &mut OpState, rid: ResourceId, - url: String, + url: &str, ) -> Result<(), Error> { let wasm_streaming = state.resource_table.get::(rid)?; - wasm_streaming.0.borrow_mut().set_url(&url); + wasm_streaming.0.borrow_mut().set_url(url); Ok(()) } -- cgit v1.2.3