From 4a80838151a9945438739ab937c415939e2ccf5b Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Tue, 5 Dec 2023 00:55:50 +0100 Subject: rt: extend runtime to allow adding multiple code blocks --- examples/add.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/add.rs') diff --git a/examples/add.rs b/examples/add.rs index ef010b6..8cd1984 100644 --- a/examples/add.rs +++ b/examples/add.rs @@ -22,8 +22,8 @@ fn main() { let code = asm.into_code(); std::fs::write("jit.asm", &code).unwrap(); - let rt = Runtime::new(&code); - let add42 = unsafe { rt.as_fn:: u32>() }; + let mut rt = Runtime::new(); + let add42 = unsafe { rt.add_code:: u32>(code) }; let res = add42(5); assert_eq!(res, 47); -- cgit v1.2.3