Skip to content

Commit a01bb8f

Browse files
committed
Add JitEngine.with_function_unchecked
1 parent 718c1bb commit a01bb8f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/engine.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ impl<'a, 'b> JitEngine<'a> {
117117
cb(self.get_function::<A, R>(function));
118118
}
119119
}
120+
/// Run the closure `cb` with the machine code for the function `function`.
121+
pub unsafe fn with_function_unchecked<C, A, R>(&self, function: &'b Function, cb: C) where A:Compile<'b>, R:Compile<'b>, C:FnOnce(extern fn(A) -> R) {
122+
cb(self.get_function::<A, R>(function));
123+
}
120124
/// Returns a pointer to the machine code for the function `function`.
121125
///
122126
/// This is marked as unsafe because the types given as arguments and return could be different

0 commit comments

Comments
 (0)