summaryrefslogtreecommitdiff
path: root/runtime/ops/signal.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-03-03 19:04:10 +0530
committerGitHub <noreply@github.com>2023-03-03 19:04:10 +0530
commit38555a6a0fe9a7235776afe0ebfb2a24dc518391 (patch)
treeef9506c500451e5f2ef4ae5b70eda85c7147a25e /runtime/ops/signal.rs
parent64503fabd81e38c58d44d23ae94f5b87a384b86e (diff)
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
Diffstat (limited to 'runtime/ops/signal.rs')
-rw-r--r--runtime/ops/signal.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/ops/signal.rs b/runtime/ops/signal.rs
index 39458bad9..c2105a64e 100644
--- a/runtime/ops/signal.rs
+++ b/runtime/ops/signal.rs
@@ -463,9 +463,9 @@ pub fn signal_int_to_str(s: libc::c_int) -> Result<&'static str, AnyError> {
#[op]
fn op_signal_bind(
state: &mut OpState,
- sig: String,
+ sig: &str,
) -> Result<ResourceId, AnyError> {
- let signo = signal_str_to_int(&sig)?;
+ let signo = signal_str_to_int(sig)?;
if signal_hook_registry::FORBIDDEN.contains(&signo) {
return Err(type_error(format!(
"Binding to signal '{sig}' is not allowed",
@@ -483,9 +483,9 @@ fn op_signal_bind(
#[op]
fn op_signal_bind(
state: &mut OpState,
- sig: String,
+ sig: &str,
) -> Result<ResourceId, AnyError> {
- let signo = signal_str_to_int(&sig)?;
+ let signo = signal_str_to_int(sig)?;
let resource = SignalStreamResource {
signal: AsyncRefCell::new(match signo {
// SIGINT