From 550a1794e9460467c474d56554b62942bf911a9c Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 13 Dec 2024 22:47:47 +0000 Subject: deploy: 869761849ff64669244b6cbb79cac41f66654041 --- juicebox_asm/struct.Runtime.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'juicebox_asm/struct.Runtime.html') diff --git a/juicebox_asm/struct.Runtime.html b/juicebox_asm/struct.Runtime.html index 8da3fb1..908c529 100644 --- a/juicebox_asm/struct.Runtime.html +++ b/juicebox_asm/struct.Runtime.html @@ -1,14 +1,14 @@ -Runtime in juicebox_asm - Rust
juicebox_asm

Struct Runtime

source
pub struct Runtime { /* private fields */ }
Expand description

A simple mmaped runtime with executable pages.

-

Implementations§

source§

impl Runtime

source

pub fn new() -> Runtime

Create a new Runtime.

+Runtime in juicebox_asm - Rust
juicebox_asm

Struct Runtime

source
pub struct Runtime { /* private fields */ }
Expand description

A simple mmaped runtime with executable pages.

+

Implementations§

source§

impl Runtime

source

pub fn new() -> Runtime

Create a new Runtime.

§Panics

Panics if the mmap call fails.

-
source

pub fn with_profile() -> Runtime

Create a new Runtime which also generates static perf metat data.

+
source

pub fn with_profile() -> Runtime

Create a new Runtime which also generates static perf metat data.

For each function added to the Runtime, an entry will be generated in the /tmp/perf-<PID>.map file, which perf report uses to symbolicate unknown addresses. This is applicable for static runtimes only.

§Panics

Panics if the mmap call fails.

-
source

pub unsafe fn add_code<F>(&mut self, code: impl AsRef<[u8]>) -> F

Add the block of code to the runtime and a get function pointer of type F.

+
source

pub unsafe fn add_code<F>(&mut self, code: impl AsRef<[u8]>) -> F

Add the block of code to the runtime and a get function pointer of type F.

§Panics

Panics if the code does not fit on the mmaped pages or is empty.

§Safety
@@ -21,13 +21,13 @@ pointer is only valid until the let nop = unsafe { rt.add_code::<extern "C" fn()>(&code) }; nop();
-
source

pub fn dump(&self)

Dump the code added so far to the runtime into a file called jit.asm in the processes +

source

pub fn dump(&self)

Dump the code added so far to the runtime into a file called jit.asm in the processes current working directory.

The code can be inspected with a disassembler as for example ndiasm from nasm.us.

ndisasm -b 64 jit.asm
§Panics

Panics if writing the file failed.

-

Trait Implementations§

source§

impl Drop for Runtime

source§

fn drop(&mut self)

Unmaps the code page. This invalidates all the function pointer returned by +

Trait Implementations§

source§

impl Drop for Runtime

source§

fn drop(&mut self)

Unmaps the code page. This invalidates all the function pointer returned by Runtime::add_code.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where -- cgit v1.2.3