MCPcopy Index your code
hub / github.com/Amanieu/naked-function

github.com/Amanieu/naked-function @0.1.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.1.5 ↗ · + Follow
52 symbols 89 edges 10 files 5 documented · 10% updated 3y ago★ 332 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

#[naked]

Crates.io

Documentation

This crate provide a proc macro version of the #[naked] attribute which can be used on stable Rust.

Example

// The SYSV64 calling convention used on x86_64 Linux passes the first
// 2 integer arguments in EDI/ESI.
#[naked_function::naked]
pub unsafe extern "C" fn add(a: i32, b: i32) -> i32 {
    asm!(
        "lea eax, [edi + esi]",
        "ret",
    );
}

#[test]
fn main() {
    let ret = unsafe { add(1, 2) };
    assert_eq!(ret, 3);
}

License

Licensed under either of:

  • Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Core symbols most depended-on inside this repo

validate_sig
called by 1
naked-function-macro/src/naked.rs
parse_attrs
called by 1
naked-function-macro/src/naked.rs
emit_foreign_mod
called by 1
naked-function-macro/src/naked.rs
emit_global_asm
called by 1
naked-function-macro/src/naked.rs
naked_attribute
called by 1
naked-function-macro/src/naked.rs
to_tokens
called by 1
naked-function-macro/src/asm.rs
extract_asm
called by 1
naked-function-macro/src/asm.rs
add
called by 1
tests/x86_64.rs

Shape

Function 48
Method 2
Class 1
Enum 1

Languages

Rust100%

Modules by API surface

tests/arm.rs15 symbols
tests/x86_64.rs11 symbols
tests/aarch64.rs11 symbols
naked-function-macro/src/naked.rs6 symbols
naked-function-macro/src/asm.rs4 symbols
tests/conditional.rs2 symbols
tests/rustfmt.rs1 symbols
naked-function-macro/src/lib.rs1 symbols
build.rs1 symbols

For agents

$ claude mcp add naked-function \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact