Crates.io | jit_rs |
lib.rs | jit_rs |
version | 0.1.3 |
source | src |
created_at | 2021-07-02 08:45:31.299959 |
updated_at | 2021-07-02 13:34:37.18232 |
description | jit.rs is a library for generating, optimizing and running executable code at runtime |
homepage | https://crates.io/crates/jit_rs/ |
repository | https://github.com/serid/jit.rs |
max_upload_size | |
id | 417727 |
size | 7,898 |
jit.rs
is a library for generating, optimizing and running executable code at runtime.
fn main() {
// Machine code that returns int value 13
let bytes = [0xb8, 0x0d, 0x00, 0x00, 0x00, 0xc3];
// Execute code stored in `bytes`
let r = unsafe { jit_rs::execute_bytes::<i32>(&bytes) };
// Prints 13
println!("Hello, world! {}", r);
}