Skip to content

Commit 2fff142

Browse files
author
Lucas Paixão
committed
Optimize frequent path
1 parent 4550e6f commit 2fff142

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/runtime/context.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ impl RuntimeContext {
6060
roc.dispatch_completions()
6161
}
6262

63+
pub(crate) fn flush(&self) {
64+
let roc = unsafe { &*self.driver.as_ptr() };
65+
let _ = roc.flush();
66+
}
67+
6368
#[inline(always)]
6469
pub(crate) fn call_on_thread_park(&self) {
6570
self.on_thread_park.get()();

src/runtime/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl Runtime {
146146

147147
fn on_thread_park() {
148148
CONTEXT.with(|x| {
149-
let _ = x.handle().flush();
149+
x.flush();
150150
});
151151
}
152152

0 commit comments

Comments
 (0)