java-ffm

Community

Safely call native C from Java 26

Authorbugabinga
Version1.0.0
Installs0

System Documentation

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.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: java-ffm
Download link: https://github.com/bugabinga/pi-ext/archive/main.zip#java-ffm

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.