padlock-core 0.9.5

Core IR, analysis passes, and findings for the padlock struct layout analyzer
Documentation

padlock-core

Core library for padlock — a struct memory layout analyzer for C, C++, Rust, and Go.

This crate provides:

  • Intermediate representation (StructLayout, Field, AccessPattern) — the shared data model all frontends and backends produce and consume
  • Architecture constants (ArchConfig) for x86-64, AArch64, Apple Silicon, WASM32, RISC-V 64
  • Analysis passes: padding detection, reorder suggestions, false-sharing detection, locality analysis, and impact scoring
  • Report types (Report, StructReport, Finding) — the output of running all analysis passes over a set of layouts

Usage

padlock-core is an internal library crate. If you want to analyze struct layouts, install the CLI:

cargo install padlock-cli

To use padlock-core in your own tool, add it as a dependency and call Report::from_layouts(&layouts).

The test-helpers feature exposes fixture layouts (connection_layout(), packed_layout()) for use in tests of crates that depend on padlock-core.

Part of padlock