MCPcopy Index your code
hub / github.com/java-native-access/jna / structureArrayCheck

Method structureArrayCheck

src/com/sun/jna/Structure.java:2312–2325  ·  view source on GitHub ↗
(Structure[] ss)

Source from the content-addressed store, hash-verified

2310 }
2311
2312 private static void structureArrayCheck(Structure[] ss) {
2313 if (Structure.ByReference[].class.isAssignableFrom(ss.getClass())) {
2314 return;
2315 }
2316 Pointer base = ss[0].getPointer();
2317 int size = ss[0].size();
2318 for (int si=1;si < ss.length;si++) {
2319 if (ss[si].getPointer().peer != base.peer + size*si) {
2320 String msg = "Structure array elements must use"
2321 + " contiguous memory (bad backing address at Structure array index " + si + ")";
2322 throw new IllegalArgumentException(msg);
2323 }
2324 }
2325 }
2326
2327 public static void autoRead(Structure[] ss) {
2328 structureArrayCheck(ss);

Callers 2

autoReadMethod · 0.95
autoWriteMethod · 0.95

Calls 2

getPointerMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected