From 9fca507f58f2b2ced731c00f5d20d542c0855906 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Tue, 5 Dec 2023 23:02:38 +0100 Subject: examples: add doc to existing examples --- examples/add.rs | 8 ++++++++ examples/fib.rs | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/examples/add.rs b/examples/add.rs index 8cd1984..ba887c4 100644 --- a/examples/add.rs +++ b/examples/add.rs @@ -1,3 +1,11 @@ +//! Add example. +//! +//! Jit compile a function at runtime (generate native host code) which calls a function defined in +//! the example based on the SystemV abi to demonstrate the [`juicebox_asm`] crate. + +#[cfg(not(any(target_arch = "x86_64", target_os = "linux")))] +compile_error!("Only supported on x86_64 with SystemV abi"); + use juicebox_asm::prelude::*; use juicebox_asm::Runtime; use Reg64::*; diff --git a/examples/fib.rs b/examples/fib.rs index 534dc13..e523b9d 100644 --- a/examples/fib.rs +++ b/examples/fib.rs @@ -1,3 +1,8 @@ +//! Fibonacci example. +//! +//! Jit compile a function at runtime (generate native host code) to compute the fibonacci sequence +//! to demonstrate the [`juicebox_asm`] crate. + use juicebox_asm::prelude::*; use juicebox_asm::Runtime; -- cgit v1.2.3