Package org.lwjgl.system.ffm.mapping


@NullMarked package org.lwjgl.system.ffm.mapping
Contains mappings between native types and MemoryLayout instances.

Most mappings are simple wrappers over FFM layouts, but they expose a richer DSL for defining custom struct/union layouts, which enables:

  • A cleaner API that doesn't pollute the static FFM API with utility methods.
  • Consistently named layouts.
  • Better handling of opaque types & pointer types. Opaque mappings cannot be used directly (they need to be wrapped in pointer mappings) and pointer mappings cannot be created without a target mapping.
  • Enrichment of integer layouts with signedness.
  • Abstraction of C long types.

Users will rarely need to create mappings from scratch. It is recommended to import static the FFM class and use the base types that are defined there to typedef any custom types necessary.