summaryrefslogtreecommitdiff
path: root/core/ops.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-03-08 22:21:14 +0530
committerGitHub <noreply@github.com>2023-03-08 22:21:14 +0530
commit0cce9c2bcc9667935a571d30847e66ef5d01a196 (patch)
tree3e188f47a7c8350a3f48fe5ec3a0b256351d41b9 /core/ops.rs
parent06a12341c66e0a44436e1178603e0f398bfae10c (diff)
feat(core): prevent isolate drop for CLI main worker (#18059)
``` Benchmark 1: deno run -A ../empty.js Time (mean ± σ): 20.5 ms ± 0.5 ms [User: 13.4 ms, System: 5.1 ms] Range (min … max): 19.8 ms … 24.0 ms 119 runs Benchmark 2: target/release/deno run -A ../empty.js Time (mean ± σ): 18.8 ms ± 0.3 ms [User: 13.0 ms, System: 4.9 ms] Range (min … max): 18.3 ms … 19.9 ms 129 runs ``` --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Diffstat (limited to 'core/ops.rs')
-rw-r--r--core/ops.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/ops.rs b/core/ops.rs
index ca465c821..b2442634e 100644
--- a/core/ops.rs
+++ b/core/ops.rs
@@ -179,6 +179,10 @@ impl OpState {
tracker: OpsTracker::new(ops_count),
}
}
+
+ pub fn clear_state(&mut self) {
+ self.gotham_state.clear();
+ }
}
impl Deref for OpState {