alef 0.77.0

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
    // `{{ context_type }}` exactly as the FFI backend lays it out in C:
    // {{ byte_size }} bytes, {{ byte_alignment }}-byte aligned.
    private static final MemoryLayout CTX_LAYOUT =
        MemoryLayout.structLayout(
{% for member in members %}
            {{ member }}{{ "," if not loop.last }}
{% endfor %}
        );

{% for offset in offsets %}
    private static final long {{ offset.constant }} =
        CTX_LAYOUT.byteOffset(MemoryLayout.PathElement.groupElement("{{ offset.name }}"));
{% endfor %}