You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BridJ: changed the new Pointer.toList() and toList(ListType) to asList() / asList(ListType), following discussion with Csaba (the returned list is a view of the pointed memory, at least just when it's returned ; after mutating it, if it's a dynamic list, the list might use a different reallocated pointer, but that's another matter that's stated in the doc anyway).
Copy file name to clipboardExpand all lines: libraries/Runtime/BridJ/src/main/velocity/org/bridj/Pointer.java
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -87,8 +87,8 @@
87
87
* {@link Pointer#allocateList(Class, long) }
88
88
* </li>
89
89
* <li>Transforming a pointer to a Java {@link java.util.List} that uses the pointer as storage (think of getting back the pointer with {@link NativeList#getPointer()} when you're done mutating the list, if it's {@link ListType#Dynamic}) :<br>
90
-
* {@link Pointer#toList(ListType) }<br>
91
-
* {@link Pointer#toList() }<br>
90
+
* {@link Pointer#asList(ListType) }<br>
91
+
* {@link Pointer#asList() }<br>
92
92
* </li>
93
93
* </ul>
94
94
* <p>
@@ -2832,7 +2832,7 @@ public <U> U[] toArray(U[] array) {
2832
2832
}
2833
2833
2834
2834
/**
2835
-
* Types of pointer-based list implementations that can be created through {@link Pointer#toList()} or {@link Pointer#toList(ListType)}.
2835
+
* Types of pointer-based list implementations that can be created through {@link Pointer#asList()} or {@link Pointer#asList(ListType)}.
2836
2836
*/
2837
2837
publicenumListType {
2838
2838
/**
@@ -2851,16 +2851,16 @@ public enum ListType {
2851
2851
2852
2852
/**
2853
2853
* Create a {@link ListType#FixedCapacity} native list that uses this pointer as storage (and has this pointer's pointed valid elements as initial content).<br>
2854
-
* Same as {@link Pointer#toList(ListType)}({@link ListType#FixedCapacity}).
2854
+
* Same as {@link Pointer#asList(ListType)}({@link ListType#FixedCapacity}).
2855
2855
*/
2856
-
publicNativeList<T> toList() {
2857
-
returntoList(ListType.FixedCapacity);
2856
+
publicNativeList<T> asList() {
2857
+
returnasList(ListType.FixedCapacity);
2858
2858
}
2859
2859
/**
2860
2860
* Create a native list that uses this pointer as <b>initial</b> storage (and has this pointer's pointed valid elements as initial content).<br>
2861
2861
* If the list is {@link ListType#Dynamic} and if its capacity is grown at some point, this pointer will probably no longer point to the native memory storage of the list, so you need to get back the pointer with {@link NativeList#getPointer()} when you're done mutating the list.
0 commit comments