Native list is a resizable array backed by MemorySegment.
void main() {
try (var list = new IntNativeList(ListAllocator.c())) {
list.add(42);
list.add(43);
assertEquals(42, list.get(0));
assertEquals(43, list.get(1));
} // the list is automatically released
}Check wiki for details.
This library requires JDK 25.
Maven:
<dependency>
<groupId>io.github.over-run</groupId>
<artifactId>native-list</artifactId>
<version>${nativeListVersion}</version>
</dependency>Gradle:
dependencies {
implementation("io.github.over-run:native-list:${nativeListVersion}")
}This library provides a list allocator using MemoryUtil of LWJGL 3.
Gradle:
dependencies {
implementation("io.github.over-run:native-list-lwjgl3:${nativeListLwjgl3Version}")
}