Skip to content

Commit f4f69aa

Browse files
committed
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).
1 parent 24c3398 commit f4f69aa

File tree

1 file changed

+7
-7
lines changed
  • libraries/Runtime/BridJ/src/main/velocity/org/bridj

1 file changed

+7
-7
lines changed

libraries/Runtime/BridJ/src/main/velocity/org/bridj/Pointer.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
* {@link Pointer#allocateList(Class, long) }
8888
* </li>
8989
* <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>
9292
* </li>
9393
* </ul>
9494
* <p>
@@ -2832,7 +2832,7 @@ public <U> U[] toArray(U[] array) {
28322832
}
28332833

28342834
/**
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)}.
28362836
*/
28372837
public enum ListType {
28382838
/**
@@ -2851,16 +2851,16 @@ public enum ListType {
28512851

28522852
/**
28532853
* 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}).
28552855
*/
2856-
public NativeList<T> toList() {
2857-
return toList(ListType.FixedCapacity);
2856+
public NativeList<T> asList() {
2857+
return asList(ListType.FixedCapacity);
28582858
}
28592859
/**
28602860
* 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>
28612861
* 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.
28622862
*/
2863-
public NativeList<T> toList(ListType type) {
2863+
public NativeList<T> asList(ListType type) {
28642864
return new DefaultNativeList(this, type);
28652865
}
28662866
/**

0 commit comments

Comments
 (0)