diff options
Diffstat (limited to 'examples/fib.rs')
-rw-r--r-- | examples/fib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/fib.rs b/examples/fib.rs index 7acbb50..534dc13 100644 --- a/examples/fib.rs +++ b/examples/fib.rs @@ -62,8 +62,8 @@ fn main() { std::fs::write("jit.asm", &code).unwrap(); // Move code into executable page and get function pointer to it. - let rt = Runtime::new(&code); - let fib = unsafe { rt.as_fn::<extern "C" fn(u64) -> u64>() }; + let mut rt = Runtime::new(); + let fib = unsafe { rt.add_code::<extern "C" fn(u64) -> u64>(code) }; for n in 0..15 { let fib_jit = fib(n); |