Skip to content

Commit 74315ec

Browse files
committed
feat: add NativeList::resize, move nested class to upper level
move NativeList.Allocator to ListAllocator move NativeList.AllocatorFactory to ListAllocatorFactory
1 parent 3de81a7 commit 74315ec

18 files changed

Lines changed: 232 additions & 190 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ jobs:
2828
java-version: '25'
2929
distribution: 'temurin'
3030

31+
- name: Make gradlew executable
32+
if: ${{ runner.os != 'Windows' }}
33+
run: chmod +x ./gradlew
34+
3135
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
3236
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
3337
- name: Setup Gradle

gen/src/main/java/Main.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,29 +80,29 @@ void generateClass(Path packageDir, Type type) throws IOException {
8080
sb.append("public class ").append(type.prefix).append("NativeList extends NativeList implements ").append(type.prefix).appendLine("NativeListView {");
8181

8282
sb.append(" /// Constructor of [").append(type.prefix).appendLine("NativeList].");
83-
sb.appendLine(" /// @param allocatorFactory a factory of the [allocator][Allocator]");
83+
sb.appendLine(" /// @param allocatorFactory a factory of the [allocator][ListAllocator]");
8484
sb.appendLine(" /// @param initialCapacity the initial capacity of the native list; defaults to 8");
8585
sb.appendLine(" /// @throws IllegalArgumentException if `initialCapacity < 0`");
86-
sb.append(" public ").append(type.prefix).appendLine("NativeList(AllocatorFactory allocatorFactory, long initialCapacity) {");
86+
sb.append(" public ").append(type.prefix).appendLine("NativeList(ListAllocatorFactory allocatorFactory, long initialCapacity) {");
8787
sb.append(" super(").append(type.valueLayout).appendLine(", allocatorFactory, initialCapacity);");
8888
sb.append(" }");
8989
sb.appendLine();
9090

9191
sb.append(" /// Constructor of [").append(type.prefix).appendLine("NativeList].");
9292
sb.appendLine(" ///");
9393
sb.appendLine(" /// It is recommended to construct a native list with an initial capacity.");
94-
sb.appendLine(" /// @param allocatorFactory a factory of the [allocator][Allocator]");
95-
sb.append(" public ").append(type.prefix).appendLine("NativeList(AllocatorFactory allocatorFactory) {");
94+
sb.appendLine(" /// @param allocatorFactory a factory of the [allocator][ListAllocator]");
95+
sb.append(" public ").append(type.prefix).appendLine("NativeList(ListAllocatorFactory allocatorFactory) {");
9696
sb.append(" super(").append(type.valueLayout).appendLine(", allocatorFactory);");
9797
sb.appendLine(" }");
9898
sb.appendLine();
9999

100100
sb.append(" /// Constructor of [").append(type.prefix).appendLine("NativeList].");
101101
sb.appendLine(" ///");
102102
sb.appendLine(" /// This copies element layout and data from `list`.");
103-
sb.appendLine(" /// @param allocatorFactory a factory of the [allocator][Allocator]");
103+
sb.appendLine(" /// @param allocatorFactory a factory of the [allocator][ListAllocator]");
104104
sb.appendLine(" /// @param list the source native list");
105-
sb.append(" public ").append(type.prefix).append("NativeList(AllocatorFactory allocatorFactory, ").append(type.prefix).appendLine("NativeList list) {");
105+
sb.append(" public ").append(type.prefix).append("NativeList(ListAllocatorFactory allocatorFactory, ").append(type.prefix).appendLine("NativeList list) {");
106106
sb.appendLine(" super(allocatorFactory, list);");
107107
sb.appendLine(" }");
108108
sb.appendLine();

src/main/generated/io/github/overrun/nativelist/AddressNativeList.java

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/generated/io/github/overrun/nativelist/BoolNativeList.java

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/generated/io/github/overrun/nativelist/ByteNativeList.java

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/generated/io/github/overrun/nativelist/CharNativeList.java

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/generated/io/github/overrun/nativelist/DoubleNativeList.java

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/generated/io/github/overrun/nativelist/FloatNativeList.java

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/generated/io/github/overrun/nativelist/IntNativeList.java

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/generated/io/github/overrun/nativelist/LongNativeList.java

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)