What problem does it solve?
It helps you write and review Java code that uses the Java 26 Foreign Function & Memory API (FFM) correctly and safely, so you avoid JVM crashes and subtle ABI/lifetime bugs when calling native C libraries or passing pointers and callbacks.
Core Features & Use Cases
- Native calling and binding review: Verify C ABI/platform details, exact function signatures, library lookup choices, and error conventions before downcalls.
- Correct off-heap memory modeling: Use arenas, memory segments, and explicit
MemoryLayout/ValueLayout/FunctionDescriptor definitions to prevent wrong-size and out-of-bounds access.
- Pointer and callback correctness: Distinguish returned pointers vs pointer out-parameters (e.g.,
T**), and ensure upcall stubs and arenas have lifetimes compatible with native usage.
Quick Start
Use the java-ffm skill while reviewing your Java FFM bindings and ask it to sanity-check your downcall descriptors, pointer handling, and arena lifetimes for the target native function.