All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.bechberger.ebpf.bpf.raw.bpf_prog_info Maven / Gradle / Ivy

The newest version!
// Generated by jextract

package me.bechberger.ebpf.bpf.raw;

import java.lang.invoke.*;
import java.lang.foreign.*;
import java.nio.ByteOrder;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

import static java.lang.foreign.ValueLayout.*;
import static java.lang.foreign.MemoryLayout.PathElement.*;

/**
 * {@snippet lang=c :
 * struct bpf_prog_info {
 *     __u32 type;
 *     __u32 id;
 *     __u8 tag[8];
 *     __u32 jited_prog_len;
 *     __u32 xlated_prog_len;
 *     __u64 jited_prog_insns;
 *     __u64 xlated_prog_insns;
 *     __u64 load_time;
 *     __u32 created_by_uid;
 *     __u32 nr_map_ids;
 *     __u64 map_ids;
 *     char name[16];
 *     __u32 ifindex;
 *     __u32 gpl_compatible : 1;
 *     __u32 : 31;
 *     __u64 netns_dev;
 *     __u64 netns_ino;
 *     __u32 nr_jited_ksyms;
 *     __u32 nr_jited_func_lens;
 *     __u64 jited_ksyms;
 *     __u64 jited_func_lens;
 *     __u32 btf_id;
 *     __u32 func_info_rec_size;
 *     __u64 func_info;
 *     __u32 nr_func_info;
 *     __u32 nr_line_info;
 *     __u64 line_info;
 *     __u64 jited_line_info;
 *     __u32 nr_jited_line_info;
 *     __u32 line_info_rec_size;
 *     __u32 jited_line_info_rec_size;
 *     __u32 nr_prog_tags;
 *     __u64 prog_tags;
 *     __u64 run_time_ns;
 *     __u64 run_cnt;
 *     __u64 recursion_misses;
 *     __u32 verified_insns;
 *     __u32 attach_btf_obj_id;
 *     __u32 attach_btf_id;
 * }
 * }
 */
public class bpf_prog_info {

    bpf_prog_info() {
        // Should not be called directly
    }

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        Lib.C_INT.withName("type"),
        Lib.C_INT.withName("id"),
        MemoryLayout.sequenceLayout(8, Lib.C_CHAR).withName("tag"),
        Lib.C_INT.withName("jited_prog_len"),
        Lib.C_INT.withName("xlated_prog_len"),
        Lib.C_LONG_LONG.withName("jited_prog_insns"),
        Lib.C_LONG_LONG.withName("xlated_prog_insns"),
        Lib.C_LONG_LONG.withName("load_time"),
        Lib.C_INT.withName("created_by_uid"),
        Lib.C_INT.withName("nr_map_ids"),
        Lib.C_LONG_LONG.withName("map_ids"),
        MemoryLayout.sequenceLayout(16, Lib.C_CHAR).withName("name"),
        Lib.C_INT.withName("ifindex"),
        MemoryLayout.paddingLayout(4),
        Lib.C_LONG_LONG.withName("netns_dev"),
        Lib.C_LONG_LONG.withName("netns_ino"),
        Lib.C_INT.withName("nr_jited_ksyms"),
        Lib.C_INT.withName("nr_jited_func_lens"),
        Lib.C_LONG_LONG.withName("jited_ksyms"),
        Lib.C_LONG_LONG.withName("jited_func_lens"),
        Lib.C_INT.withName("btf_id"),
        Lib.C_INT.withName("func_info_rec_size"),
        Lib.C_LONG_LONG.withName("func_info"),
        Lib.C_INT.withName("nr_func_info"),
        Lib.C_INT.withName("nr_line_info"),
        Lib.C_LONG_LONG.withName("line_info"),
        Lib.C_LONG_LONG.withName("jited_line_info"),
        Lib.C_INT.withName("nr_jited_line_info"),
        Lib.C_INT.withName("line_info_rec_size"),
        Lib.C_INT.withName("jited_line_info_rec_size"),
        Lib.C_INT.withName("nr_prog_tags"),
        Lib.C_LONG_LONG.withName("prog_tags"),
        Lib.C_LONG_LONG.withName("run_time_ns"),
        Lib.C_LONG_LONG.withName("run_cnt"),
        Lib.C_LONG_LONG.withName("recursion_misses"),
        Lib.C_INT.withName("verified_insns"),
        Lib.C_INT.withName("attach_btf_obj_id"),
        Lib.C_INT.withName("attach_btf_id"),
        MemoryLayout.paddingLayout(4)
    ).withName("bpf_prog_info");

    /**
     * The layout of this struct
     */
    public static final GroupLayout layout() {
        return $LAYOUT;
    }

    private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 type
     * }
     */
    public static final OfInt type$layout() {
        return type$LAYOUT;
    }

    private static final long type$OFFSET = 0;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 type
     * }
     */
    public static final long type$offset() {
        return type$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 type
     * }
     */
    public static int type(MemorySegment struct) {
        return struct.get(type$LAYOUT, type$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 type
     * }
     */
    public static void type(MemorySegment struct, int fieldValue) {
        struct.set(type$LAYOUT, type$OFFSET, fieldValue);
    }

    private static final OfInt id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("id"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 id
     * }
     */
    public static final OfInt id$layout() {
        return id$LAYOUT;
    }

    private static final long id$OFFSET = 4;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 id
     * }
     */
    public static final long id$offset() {
        return id$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 id
     * }
     */
    public static int id(MemorySegment struct) {
        return struct.get(id$LAYOUT, id$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 id
     * }
     */
    public static void id(MemorySegment struct, int fieldValue) {
        struct.set(id$LAYOUT, id$OFFSET, fieldValue);
    }

    private static final SequenceLayout tag$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("tag"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u8 tag[8]
     * }
     */
    public static final SequenceLayout tag$layout() {
        return tag$LAYOUT;
    }

    private static final long tag$OFFSET = 8;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u8 tag[8]
     * }
     */
    public static final long tag$offset() {
        return tag$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u8 tag[8]
     * }
     */
    public static MemorySegment tag(MemorySegment struct) {
        return struct.asSlice(tag$OFFSET, tag$LAYOUT.byteSize());
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u8 tag[8]
     * }
     */
    public static void tag(MemorySegment struct, MemorySegment fieldValue) {
        MemorySegment.copy(fieldValue, 0L, struct, tag$OFFSET, tag$LAYOUT.byteSize());
    }

    private static long[] tag$DIMS = { 8 };

    /**
     * Dimensions for array field:
     * {@snippet lang=c :
     * __u8 tag[8]
     * }
     */
    public static long[] tag$dimensions() {
        return tag$DIMS;
    }
    private static final VarHandle tag$ELEM_HANDLE = tag$LAYOUT.varHandle(sequenceElement());

    /**
     * Indexed getter for field:
     * {@snippet lang=c :
     * __u8 tag[8]
     * }
     */
    public static byte tag(MemorySegment struct, long index0) {
        return (byte)tag$ELEM_HANDLE.get(struct, 0L, index0);
    }

    /**
     * Indexed setter for field:
     * {@snippet lang=c :
     * __u8 tag[8]
     * }
     */
    public static void tag(MemorySegment struct, long index0, byte fieldValue) {
        tag$ELEM_HANDLE.set(struct, 0L, index0, fieldValue);
    }

    private static final OfInt jited_prog_len$LAYOUT = (OfInt)$LAYOUT.select(groupElement("jited_prog_len"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 jited_prog_len
     * }
     */
    public static final OfInt jited_prog_len$layout() {
        return jited_prog_len$LAYOUT;
    }

    private static final long jited_prog_len$OFFSET = 16;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 jited_prog_len
     * }
     */
    public static final long jited_prog_len$offset() {
        return jited_prog_len$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 jited_prog_len
     * }
     */
    public static int jited_prog_len(MemorySegment struct) {
        return struct.get(jited_prog_len$LAYOUT, jited_prog_len$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 jited_prog_len
     * }
     */
    public static void jited_prog_len(MemorySegment struct, int fieldValue) {
        struct.set(jited_prog_len$LAYOUT, jited_prog_len$OFFSET, fieldValue);
    }

    private static final OfInt xlated_prog_len$LAYOUT = (OfInt)$LAYOUT.select(groupElement("xlated_prog_len"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 xlated_prog_len
     * }
     */
    public static final OfInt xlated_prog_len$layout() {
        return xlated_prog_len$LAYOUT;
    }

    private static final long xlated_prog_len$OFFSET = 20;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 xlated_prog_len
     * }
     */
    public static final long xlated_prog_len$offset() {
        return xlated_prog_len$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 xlated_prog_len
     * }
     */
    public static int xlated_prog_len(MemorySegment struct) {
        return struct.get(xlated_prog_len$LAYOUT, xlated_prog_len$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 xlated_prog_len
     * }
     */
    public static void xlated_prog_len(MemorySegment struct, int fieldValue) {
        struct.set(xlated_prog_len$LAYOUT, xlated_prog_len$OFFSET, fieldValue);
    }

    private static final OfLong jited_prog_insns$LAYOUT = (OfLong)$LAYOUT.select(groupElement("jited_prog_insns"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 jited_prog_insns
     * }
     */
    public static final OfLong jited_prog_insns$layout() {
        return jited_prog_insns$LAYOUT;
    }

    private static final long jited_prog_insns$OFFSET = 24;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 jited_prog_insns
     * }
     */
    public static final long jited_prog_insns$offset() {
        return jited_prog_insns$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 jited_prog_insns
     * }
     */
    public static long jited_prog_insns(MemorySegment struct) {
        return struct.get(jited_prog_insns$LAYOUT, jited_prog_insns$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 jited_prog_insns
     * }
     */
    public static void jited_prog_insns(MemorySegment struct, long fieldValue) {
        struct.set(jited_prog_insns$LAYOUT, jited_prog_insns$OFFSET, fieldValue);
    }

    private static final OfLong xlated_prog_insns$LAYOUT = (OfLong)$LAYOUT.select(groupElement("xlated_prog_insns"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 xlated_prog_insns
     * }
     */
    public static final OfLong xlated_prog_insns$layout() {
        return xlated_prog_insns$LAYOUT;
    }

    private static final long xlated_prog_insns$OFFSET = 32;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 xlated_prog_insns
     * }
     */
    public static final long xlated_prog_insns$offset() {
        return xlated_prog_insns$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 xlated_prog_insns
     * }
     */
    public static long xlated_prog_insns(MemorySegment struct) {
        return struct.get(xlated_prog_insns$LAYOUT, xlated_prog_insns$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 xlated_prog_insns
     * }
     */
    public static void xlated_prog_insns(MemorySegment struct, long fieldValue) {
        struct.set(xlated_prog_insns$LAYOUT, xlated_prog_insns$OFFSET, fieldValue);
    }

    private static final OfLong load_time$LAYOUT = (OfLong)$LAYOUT.select(groupElement("load_time"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 load_time
     * }
     */
    public static final OfLong load_time$layout() {
        return load_time$LAYOUT;
    }

    private static final long load_time$OFFSET = 40;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 load_time
     * }
     */
    public static final long load_time$offset() {
        return load_time$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 load_time
     * }
     */
    public static long load_time(MemorySegment struct) {
        return struct.get(load_time$LAYOUT, load_time$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 load_time
     * }
     */
    public static void load_time(MemorySegment struct, long fieldValue) {
        struct.set(load_time$LAYOUT, load_time$OFFSET, fieldValue);
    }

    private static final OfInt created_by_uid$LAYOUT = (OfInt)$LAYOUT.select(groupElement("created_by_uid"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 created_by_uid
     * }
     */
    public static final OfInt created_by_uid$layout() {
        return created_by_uid$LAYOUT;
    }

    private static final long created_by_uid$OFFSET = 48;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 created_by_uid
     * }
     */
    public static final long created_by_uid$offset() {
        return created_by_uid$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 created_by_uid
     * }
     */
    public static int created_by_uid(MemorySegment struct) {
        return struct.get(created_by_uid$LAYOUT, created_by_uid$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 created_by_uid
     * }
     */
    public static void created_by_uid(MemorySegment struct, int fieldValue) {
        struct.set(created_by_uid$LAYOUT, created_by_uid$OFFSET, fieldValue);
    }

    private static final OfInt nr_map_ids$LAYOUT = (OfInt)$LAYOUT.select(groupElement("nr_map_ids"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 nr_map_ids
     * }
     */
    public static final OfInt nr_map_ids$layout() {
        return nr_map_ids$LAYOUT;
    }

    private static final long nr_map_ids$OFFSET = 52;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 nr_map_ids
     * }
     */
    public static final long nr_map_ids$offset() {
        return nr_map_ids$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 nr_map_ids
     * }
     */
    public static int nr_map_ids(MemorySegment struct) {
        return struct.get(nr_map_ids$LAYOUT, nr_map_ids$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 nr_map_ids
     * }
     */
    public static void nr_map_ids(MemorySegment struct, int fieldValue) {
        struct.set(nr_map_ids$LAYOUT, nr_map_ids$OFFSET, fieldValue);
    }

    private static final OfLong map_ids$LAYOUT = (OfLong)$LAYOUT.select(groupElement("map_ids"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 map_ids
     * }
     */
    public static final OfLong map_ids$layout() {
        return map_ids$LAYOUT;
    }

    private static final long map_ids$OFFSET = 56;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 map_ids
     * }
     */
    public static final long map_ids$offset() {
        return map_ids$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 map_ids
     * }
     */
    public static long map_ids(MemorySegment struct) {
        return struct.get(map_ids$LAYOUT, map_ids$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 map_ids
     * }
     */
    public static void map_ids(MemorySegment struct, long fieldValue) {
        struct.set(map_ids$LAYOUT, map_ids$OFFSET, fieldValue);
    }

    private static final SequenceLayout name$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("name"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * char name[16]
     * }
     */
    public static final SequenceLayout name$layout() {
        return name$LAYOUT;
    }

    private static final long name$OFFSET = 64;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * char name[16]
     * }
     */
    public static final long name$offset() {
        return name$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * char name[16]
     * }
     */
    public static MemorySegment name(MemorySegment struct) {
        return struct.asSlice(name$OFFSET, name$LAYOUT.byteSize());
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * char name[16]
     * }
     */
    public static void name(MemorySegment struct, MemorySegment fieldValue) {
        MemorySegment.copy(fieldValue, 0L, struct, name$OFFSET, name$LAYOUT.byteSize());
    }

    private static long[] name$DIMS = { 16 };

    /**
     * Dimensions for array field:
     * {@snippet lang=c :
     * char name[16]
     * }
     */
    public static long[] name$dimensions() {
        return name$DIMS;
    }
    private static final VarHandle name$ELEM_HANDLE = name$LAYOUT.varHandle(sequenceElement());

    /**
     * Indexed getter for field:
     * {@snippet lang=c :
     * char name[16]
     * }
     */
    public static byte name(MemorySegment struct, long index0) {
        return (byte)name$ELEM_HANDLE.get(struct, 0L, index0);
    }

    /**
     * Indexed setter for field:
     * {@snippet lang=c :
     * char name[16]
     * }
     */
    public static void name(MemorySegment struct, long index0, byte fieldValue) {
        name$ELEM_HANDLE.set(struct, 0L, index0, fieldValue);
    }

    private static final OfInt ifindex$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ifindex"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 ifindex
     * }
     */
    public static final OfInt ifindex$layout() {
        return ifindex$LAYOUT;
    }

    private static final long ifindex$OFFSET = 80;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 ifindex
     * }
     */
    public static final long ifindex$offset() {
        return ifindex$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 ifindex
     * }
     */
    public static int ifindex(MemorySegment struct) {
        return struct.get(ifindex$LAYOUT, ifindex$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 ifindex
     * }
     */
    public static void ifindex(MemorySegment struct, int fieldValue) {
        struct.set(ifindex$LAYOUT, ifindex$OFFSET, fieldValue);
    }

    private static final OfLong netns_dev$LAYOUT = (OfLong)$LAYOUT.select(groupElement("netns_dev"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 netns_dev
     * }
     */
    public static final OfLong netns_dev$layout() {
        return netns_dev$LAYOUT;
    }

    private static final long netns_dev$OFFSET = 88;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 netns_dev
     * }
     */
    public static final long netns_dev$offset() {
        return netns_dev$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 netns_dev
     * }
     */
    public static long netns_dev(MemorySegment struct) {
        return struct.get(netns_dev$LAYOUT, netns_dev$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 netns_dev
     * }
     */
    public static void netns_dev(MemorySegment struct, long fieldValue) {
        struct.set(netns_dev$LAYOUT, netns_dev$OFFSET, fieldValue);
    }

    private static final OfLong netns_ino$LAYOUT = (OfLong)$LAYOUT.select(groupElement("netns_ino"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 netns_ino
     * }
     */
    public static final OfLong netns_ino$layout() {
        return netns_ino$LAYOUT;
    }

    private static final long netns_ino$OFFSET = 96;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 netns_ino
     * }
     */
    public static final long netns_ino$offset() {
        return netns_ino$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 netns_ino
     * }
     */
    public static long netns_ino(MemorySegment struct) {
        return struct.get(netns_ino$LAYOUT, netns_ino$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 netns_ino
     * }
     */
    public static void netns_ino(MemorySegment struct, long fieldValue) {
        struct.set(netns_ino$LAYOUT, netns_ino$OFFSET, fieldValue);
    }

    private static final OfInt nr_jited_ksyms$LAYOUT = (OfInt)$LAYOUT.select(groupElement("nr_jited_ksyms"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 nr_jited_ksyms
     * }
     */
    public static final OfInt nr_jited_ksyms$layout() {
        return nr_jited_ksyms$LAYOUT;
    }

    private static final long nr_jited_ksyms$OFFSET = 104;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 nr_jited_ksyms
     * }
     */
    public static final long nr_jited_ksyms$offset() {
        return nr_jited_ksyms$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 nr_jited_ksyms
     * }
     */
    public static int nr_jited_ksyms(MemorySegment struct) {
        return struct.get(nr_jited_ksyms$LAYOUT, nr_jited_ksyms$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 nr_jited_ksyms
     * }
     */
    public static void nr_jited_ksyms(MemorySegment struct, int fieldValue) {
        struct.set(nr_jited_ksyms$LAYOUT, nr_jited_ksyms$OFFSET, fieldValue);
    }

    private static final OfInt nr_jited_func_lens$LAYOUT = (OfInt)$LAYOUT.select(groupElement("nr_jited_func_lens"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 nr_jited_func_lens
     * }
     */
    public static final OfInt nr_jited_func_lens$layout() {
        return nr_jited_func_lens$LAYOUT;
    }

    private static final long nr_jited_func_lens$OFFSET = 108;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 nr_jited_func_lens
     * }
     */
    public static final long nr_jited_func_lens$offset() {
        return nr_jited_func_lens$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 nr_jited_func_lens
     * }
     */
    public static int nr_jited_func_lens(MemorySegment struct) {
        return struct.get(nr_jited_func_lens$LAYOUT, nr_jited_func_lens$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 nr_jited_func_lens
     * }
     */
    public static void nr_jited_func_lens(MemorySegment struct, int fieldValue) {
        struct.set(nr_jited_func_lens$LAYOUT, nr_jited_func_lens$OFFSET, fieldValue);
    }

    private static final OfLong jited_ksyms$LAYOUT = (OfLong)$LAYOUT.select(groupElement("jited_ksyms"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 jited_ksyms
     * }
     */
    public static final OfLong jited_ksyms$layout() {
        return jited_ksyms$LAYOUT;
    }

    private static final long jited_ksyms$OFFSET = 112;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 jited_ksyms
     * }
     */
    public static final long jited_ksyms$offset() {
        return jited_ksyms$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 jited_ksyms
     * }
     */
    public static long jited_ksyms(MemorySegment struct) {
        return struct.get(jited_ksyms$LAYOUT, jited_ksyms$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 jited_ksyms
     * }
     */
    public static void jited_ksyms(MemorySegment struct, long fieldValue) {
        struct.set(jited_ksyms$LAYOUT, jited_ksyms$OFFSET, fieldValue);
    }

    private static final OfLong jited_func_lens$LAYOUT = (OfLong)$LAYOUT.select(groupElement("jited_func_lens"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 jited_func_lens
     * }
     */
    public static final OfLong jited_func_lens$layout() {
        return jited_func_lens$LAYOUT;
    }

    private static final long jited_func_lens$OFFSET = 120;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 jited_func_lens
     * }
     */
    public static final long jited_func_lens$offset() {
        return jited_func_lens$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 jited_func_lens
     * }
     */
    public static long jited_func_lens(MemorySegment struct) {
        return struct.get(jited_func_lens$LAYOUT, jited_func_lens$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 jited_func_lens
     * }
     */
    public static void jited_func_lens(MemorySegment struct, long fieldValue) {
        struct.set(jited_func_lens$LAYOUT, jited_func_lens$OFFSET, fieldValue);
    }

    private static final OfInt btf_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("btf_id"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 btf_id
     * }
     */
    public static final OfInt btf_id$layout() {
        return btf_id$LAYOUT;
    }

    private static final long btf_id$OFFSET = 128;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 btf_id
     * }
     */
    public static final long btf_id$offset() {
        return btf_id$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 btf_id
     * }
     */
    public static int btf_id(MemorySegment struct) {
        return struct.get(btf_id$LAYOUT, btf_id$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 btf_id
     * }
     */
    public static void btf_id(MemorySegment struct, int fieldValue) {
        struct.set(btf_id$LAYOUT, btf_id$OFFSET, fieldValue);
    }

    private static final OfInt func_info_rec_size$LAYOUT = (OfInt)$LAYOUT.select(groupElement("func_info_rec_size"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 func_info_rec_size
     * }
     */
    public static final OfInt func_info_rec_size$layout() {
        return func_info_rec_size$LAYOUT;
    }

    private static final long func_info_rec_size$OFFSET = 132;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 func_info_rec_size
     * }
     */
    public static final long func_info_rec_size$offset() {
        return func_info_rec_size$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 func_info_rec_size
     * }
     */
    public static int func_info_rec_size(MemorySegment struct) {
        return struct.get(func_info_rec_size$LAYOUT, func_info_rec_size$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 func_info_rec_size
     * }
     */
    public static void func_info_rec_size(MemorySegment struct, int fieldValue) {
        struct.set(func_info_rec_size$LAYOUT, func_info_rec_size$OFFSET, fieldValue);
    }

    private static final OfLong func_info$LAYOUT = (OfLong)$LAYOUT.select(groupElement("func_info"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 func_info
     * }
     */
    public static final OfLong func_info$layout() {
        return func_info$LAYOUT;
    }

    private static final long func_info$OFFSET = 136;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 func_info
     * }
     */
    public static final long func_info$offset() {
        return func_info$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 func_info
     * }
     */
    public static long func_info(MemorySegment struct) {
        return struct.get(func_info$LAYOUT, func_info$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 func_info
     * }
     */
    public static void func_info(MemorySegment struct, long fieldValue) {
        struct.set(func_info$LAYOUT, func_info$OFFSET, fieldValue);
    }

    private static final OfInt nr_func_info$LAYOUT = (OfInt)$LAYOUT.select(groupElement("nr_func_info"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 nr_func_info
     * }
     */
    public static final OfInt nr_func_info$layout() {
        return nr_func_info$LAYOUT;
    }

    private static final long nr_func_info$OFFSET = 144;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 nr_func_info
     * }
     */
    public static final long nr_func_info$offset() {
        return nr_func_info$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 nr_func_info
     * }
     */
    public static int nr_func_info(MemorySegment struct) {
        return struct.get(nr_func_info$LAYOUT, nr_func_info$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 nr_func_info
     * }
     */
    public static void nr_func_info(MemorySegment struct, int fieldValue) {
        struct.set(nr_func_info$LAYOUT, nr_func_info$OFFSET, fieldValue);
    }

    private static final OfInt nr_line_info$LAYOUT = (OfInt)$LAYOUT.select(groupElement("nr_line_info"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 nr_line_info
     * }
     */
    public static final OfInt nr_line_info$layout() {
        return nr_line_info$LAYOUT;
    }

    private static final long nr_line_info$OFFSET = 148;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 nr_line_info
     * }
     */
    public static final long nr_line_info$offset() {
        return nr_line_info$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 nr_line_info
     * }
     */
    public static int nr_line_info(MemorySegment struct) {
        return struct.get(nr_line_info$LAYOUT, nr_line_info$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 nr_line_info
     * }
     */
    public static void nr_line_info(MemorySegment struct, int fieldValue) {
        struct.set(nr_line_info$LAYOUT, nr_line_info$OFFSET, fieldValue);
    }

    private static final OfLong line_info$LAYOUT = (OfLong)$LAYOUT.select(groupElement("line_info"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 line_info
     * }
     */
    public static final OfLong line_info$layout() {
        return line_info$LAYOUT;
    }

    private static final long line_info$OFFSET = 152;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 line_info
     * }
     */
    public static final long line_info$offset() {
        return line_info$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 line_info
     * }
     */
    public static long line_info(MemorySegment struct) {
        return struct.get(line_info$LAYOUT, line_info$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 line_info
     * }
     */
    public static void line_info(MemorySegment struct, long fieldValue) {
        struct.set(line_info$LAYOUT, line_info$OFFSET, fieldValue);
    }

    private static final OfLong jited_line_info$LAYOUT = (OfLong)$LAYOUT.select(groupElement("jited_line_info"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 jited_line_info
     * }
     */
    public static final OfLong jited_line_info$layout() {
        return jited_line_info$LAYOUT;
    }

    private static final long jited_line_info$OFFSET = 160;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 jited_line_info
     * }
     */
    public static final long jited_line_info$offset() {
        return jited_line_info$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 jited_line_info
     * }
     */
    public static long jited_line_info(MemorySegment struct) {
        return struct.get(jited_line_info$LAYOUT, jited_line_info$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 jited_line_info
     * }
     */
    public static void jited_line_info(MemorySegment struct, long fieldValue) {
        struct.set(jited_line_info$LAYOUT, jited_line_info$OFFSET, fieldValue);
    }

    private static final OfInt nr_jited_line_info$LAYOUT = (OfInt)$LAYOUT.select(groupElement("nr_jited_line_info"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 nr_jited_line_info
     * }
     */
    public static final OfInt nr_jited_line_info$layout() {
        return nr_jited_line_info$LAYOUT;
    }

    private static final long nr_jited_line_info$OFFSET = 168;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 nr_jited_line_info
     * }
     */
    public static final long nr_jited_line_info$offset() {
        return nr_jited_line_info$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 nr_jited_line_info
     * }
     */
    public static int nr_jited_line_info(MemorySegment struct) {
        return struct.get(nr_jited_line_info$LAYOUT, nr_jited_line_info$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 nr_jited_line_info
     * }
     */
    public static void nr_jited_line_info(MemorySegment struct, int fieldValue) {
        struct.set(nr_jited_line_info$LAYOUT, nr_jited_line_info$OFFSET, fieldValue);
    }

    private static final OfInt line_info_rec_size$LAYOUT = (OfInt)$LAYOUT.select(groupElement("line_info_rec_size"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 line_info_rec_size
     * }
     */
    public static final OfInt line_info_rec_size$layout() {
        return line_info_rec_size$LAYOUT;
    }

    private static final long line_info_rec_size$OFFSET = 172;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 line_info_rec_size
     * }
     */
    public static final long line_info_rec_size$offset() {
        return line_info_rec_size$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 line_info_rec_size
     * }
     */
    public static int line_info_rec_size(MemorySegment struct) {
        return struct.get(line_info_rec_size$LAYOUT, line_info_rec_size$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 line_info_rec_size
     * }
     */
    public static void line_info_rec_size(MemorySegment struct, int fieldValue) {
        struct.set(line_info_rec_size$LAYOUT, line_info_rec_size$OFFSET, fieldValue);
    }

    private static final OfInt jited_line_info_rec_size$LAYOUT = (OfInt)$LAYOUT.select(groupElement("jited_line_info_rec_size"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 jited_line_info_rec_size
     * }
     */
    public static final OfInt jited_line_info_rec_size$layout() {
        return jited_line_info_rec_size$LAYOUT;
    }

    private static final long jited_line_info_rec_size$OFFSET = 176;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 jited_line_info_rec_size
     * }
     */
    public static final long jited_line_info_rec_size$offset() {
        return jited_line_info_rec_size$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 jited_line_info_rec_size
     * }
     */
    public static int jited_line_info_rec_size(MemorySegment struct) {
        return struct.get(jited_line_info_rec_size$LAYOUT, jited_line_info_rec_size$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 jited_line_info_rec_size
     * }
     */
    public static void jited_line_info_rec_size(MemorySegment struct, int fieldValue) {
        struct.set(jited_line_info_rec_size$LAYOUT, jited_line_info_rec_size$OFFSET, fieldValue);
    }

    private static final OfInt nr_prog_tags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("nr_prog_tags"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 nr_prog_tags
     * }
     */
    public static final OfInt nr_prog_tags$layout() {
        return nr_prog_tags$LAYOUT;
    }

    private static final long nr_prog_tags$OFFSET = 180;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 nr_prog_tags
     * }
     */
    public static final long nr_prog_tags$offset() {
        return nr_prog_tags$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 nr_prog_tags
     * }
     */
    public static int nr_prog_tags(MemorySegment struct) {
        return struct.get(nr_prog_tags$LAYOUT, nr_prog_tags$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 nr_prog_tags
     * }
     */
    public static void nr_prog_tags(MemorySegment struct, int fieldValue) {
        struct.set(nr_prog_tags$LAYOUT, nr_prog_tags$OFFSET, fieldValue);
    }

    private static final OfLong prog_tags$LAYOUT = (OfLong)$LAYOUT.select(groupElement("prog_tags"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 prog_tags
     * }
     */
    public static final OfLong prog_tags$layout() {
        return prog_tags$LAYOUT;
    }

    private static final long prog_tags$OFFSET = 184;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 prog_tags
     * }
     */
    public static final long prog_tags$offset() {
        return prog_tags$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 prog_tags
     * }
     */
    public static long prog_tags(MemorySegment struct) {
        return struct.get(prog_tags$LAYOUT, prog_tags$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 prog_tags
     * }
     */
    public static void prog_tags(MemorySegment struct, long fieldValue) {
        struct.set(prog_tags$LAYOUT, prog_tags$OFFSET, fieldValue);
    }

    private static final OfLong run_time_ns$LAYOUT = (OfLong)$LAYOUT.select(groupElement("run_time_ns"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 run_time_ns
     * }
     */
    public static final OfLong run_time_ns$layout() {
        return run_time_ns$LAYOUT;
    }

    private static final long run_time_ns$OFFSET = 192;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 run_time_ns
     * }
     */
    public static final long run_time_ns$offset() {
        return run_time_ns$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 run_time_ns
     * }
     */
    public static long run_time_ns(MemorySegment struct) {
        return struct.get(run_time_ns$LAYOUT, run_time_ns$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 run_time_ns
     * }
     */
    public static void run_time_ns(MemorySegment struct, long fieldValue) {
        struct.set(run_time_ns$LAYOUT, run_time_ns$OFFSET, fieldValue);
    }

    private static final OfLong run_cnt$LAYOUT = (OfLong)$LAYOUT.select(groupElement("run_cnt"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 run_cnt
     * }
     */
    public static final OfLong run_cnt$layout() {
        return run_cnt$LAYOUT;
    }

    private static final long run_cnt$OFFSET = 200;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 run_cnt
     * }
     */
    public static final long run_cnt$offset() {
        return run_cnt$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 run_cnt
     * }
     */
    public static long run_cnt(MemorySegment struct) {
        return struct.get(run_cnt$LAYOUT, run_cnt$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 run_cnt
     * }
     */
    public static void run_cnt(MemorySegment struct, long fieldValue) {
        struct.set(run_cnt$LAYOUT, run_cnt$OFFSET, fieldValue);
    }

    private static final OfLong recursion_misses$LAYOUT = (OfLong)$LAYOUT.select(groupElement("recursion_misses"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u64 recursion_misses
     * }
     */
    public static final OfLong recursion_misses$layout() {
        return recursion_misses$LAYOUT;
    }

    private static final long recursion_misses$OFFSET = 208;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u64 recursion_misses
     * }
     */
    public static final long recursion_misses$offset() {
        return recursion_misses$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u64 recursion_misses
     * }
     */
    public static long recursion_misses(MemorySegment struct) {
        return struct.get(recursion_misses$LAYOUT, recursion_misses$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u64 recursion_misses
     * }
     */
    public static void recursion_misses(MemorySegment struct, long fieldValue) {
        struct.set(recursion_misses$LAYOUT, recursion_misses$OFFSET, fieldValue);
    }

    private static final OfInt verified_insns$LAYOUT = (OfInt)$LAYOUT.select(groupElement("verified_insns"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 verified_insns
     * }
     */
    public static final OfInt verified_insns$layout() {
        return verified_insns$LAYOUT;
    }

    private static final long verified_insns$OFFSET = 216;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 verified_insns
     * }
     */
    public static final long verified_insns$offset() {
        return verified_insns$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 verified_insns
     * }
     */
    public static int verified_insns(MemorySegment struct) {
        return struct.get(verified_insns$LAYOUT, verified_insns$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 verified_insns
     * }
     */
    public static void verified_insns(MemorySegment struct, int fieldValue) {
        struct.set(verified_insns$LAYOUT, verified_insns$OFFSET, fieldValue);
    }

    private static final OfInt attach_btf_obj_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("attach_btf_obj_id"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 attach_btf_obj_id
     * }
     */
    public static final OfInt attach_btf_obj_id$layout() {
        return attach_btf_obj_id$LAYOUT;
    }

    private static final long attach_btf_obj_id$OFFSET = 220;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 attach_btf_obj_id
     * }
     */
    public static final long attach_btf_obj_id$offset() {
        return attach_btf_obj_id$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 attach_btf_obj_id
     * }
     */
    public static int attach_btf_obj_id(MemorySegment struct) {
        return struct.get(attach_btf_obj_id$LAYOUT, attach_btf_obj_id$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 attach_btf_obj_id
     * }
     */
    public static void attach_btf_obj_id(MemorySegment struct, int fieldValue) {
        struct.set(attach_btf_obj_id$LAYOUT, attach_btf_obj_id$OFFSET, fieldValue);
    }

    private static final OfInt attach_btf_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("attach_btf_id"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 attach_btf_id
     * }
     */
    public static final OfInt attach_btf_id$layout() {
        return attach_btf_id$LAYOUT;
    }

    private static final long attach_btf_id$OFFSET = 224;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 attach_btf_id
     * }
     */
    public static final long attach_btf_id$offset() {
        return attach_btf_id$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 attach_btf_id
     * }
     */
    public static int attach_btf_id(MemorySegment struct) {
        return struct.get(attach_btf_id$LAYOUT, attach_btf_id$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 attach_btf_id
     * }
     */
    public static void attach_btf_id(MemorySegment struct, int fieldValue) {
        struct.set(attach_btf_id$LAYOUT, attach_btf_id$OFFSET, fieldValue);
    }

    /**
     * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
     * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
     */
    public static MemorySegment asSlice(MemorySegment array, long index) {
        return array.asSlice(layout().byteSize() * index);
    }

    /**
     * The size (in bytes) of this struct
     */
    public static long sizeof() { return layout().byteSize(); }

    /**
     * Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
     */
    public static MemorySegment allocate(SegmentAllocator allocator) {
        return allocator.allocate(layout());
    }

    /**
     * Allocate an array of size {@code elementCount} using {@code allocator}.
     * The returned segment has size {@code elementCount * layout().byteSize()}.
     */
    public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
        return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
    }

    /**
     * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
     * The returned segment has size {@code layout().byteSize()}
     */
    public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
        return reinterpret(addr, 1, arena, cleanup);
    }

    /**
     * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
     * The returned segment has size {@code elementCount * layout().byteSize()}
     */
    public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
        return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy