(Structure[] ss)
| 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); |
no test coverage detected