@Test @DisplayName("virt2phys(long)") @SuppressWarnings("ResultOfMethodCallIgnored") void virt2phys() { val bytes = createSize(0xFFFF); val virt = assumeAllocate(bytes); assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(() -> mmanager.virt2phys(virt)); mmanager.free(virt, bytes, false, false); }
@Override @Deprecated @Contract(value = "_ -> fail", pure = true) public long virt2phys(final long address) { if (!OPTIMIZED) { if (unsafe == null) throw new NullPointerException("The Unsafe object is not available."); if (address == 0) throw new IllegalArgumentException("The parameter 'address' MUST NOT be 0."); } throw new UnsupportedOperationException("The Unsafe object does not implement this operation."); }
UnsafeMemoryManager implements MemoryManager { @Override @Deprecated @Contract(value = "_ -> fail", pure = true) public long virt2phys(final long address) { if (!OPTIMIZED) { if (unsafe == null) throw new NullPointerException("The Unsafe object is not available."); if (address == 0) throw new IllegalArgumentException("The parameter 'address' MUST NOT be 0."); } throw new UnsupportedOperationException("The Unsafe object does not implement this operation."); } }
UnsafeMemoryManager implements MemoryManager { @Override @Deprecated @Contract(value = "_ -> fail", pure = true) public long virt2phys(final long address) { if (!OPTIMIZED) { if (unsafe == null) throw new NullPointerException("The Unsafe object is not available."); if (address == 0) throw new IllegalArgumentException("The parameter 'address' MUST NOT be 0."); } throw new UnsupportedOperationException("The Unsafe object does not implement this operation."); } @SuppressWarnings({"NestedTryStatement", "UseOfSunClasses"})  UnsafeMemoryManager(); }
UnsafeMemoryManager implements MemoryManager { @Override @Deprecated @Contract(value = "_ -> fail", pure = true) public long virt2phys(final long address) { if (!OPTIMIZED) { if (unsafe == null) throw new NullPointerException("The Unsafe object is not available."); if (address == 0) throw new IllegalArgumentException("The parameter 'address' MUST NOT be 0."); } throw new UnsupportedOperationException("The Unsafe object does not implement this operation."); } @SuppressWarnings({"NestedTryStatement", "UseOfSunClasses"})  UnsafeMemoryManager(); @Override @Deprecated @Contract(value = " -> fail", pure = true) long getHugepageSize(); @Override @Deprecated @SuppressWarnings("BooleanParameter") @Contract(value = "_, _, _ -> fail", pure = true) long mmap(final @NotNull File file, final boolean huge, final boolean lock); @Override @Deprecated @SuppressWarnings("BooleanParameter") @Contract(value = "_, _, _, _ -> fail", pure = true) void munmap(final long address, final @NotNull File file, final boolean huge, final boolean lock); @Override @Deprecated @Contract(value = "_ -> fail", pure = true) long virt2phys(final long address); @Override @Deprecated @SuppressWarnings("BooleanParameter") @Contract(value = "_, _, _ -> fail", pure = true) @NotNull DmaMemory dmaAllocate(final long bytes, final boolean huge, final boolean lock); @Override @Contract(pure = true) boolean isValid(); @Override @Contract(pure = true) int getAddressSize(); @Override @Contract(pure = true) long getPageSize(); @Override @SuppressWarnings("BooleanParameter") @Contract(value = "_, true, _ -> fail; _, _, true -> fail", pure = true) long allocate(final long bytes, final boolean huge, final boolean lock); @Override @SuppressWarnings("BooleanParameter") @Contract("_, _, true, _ -> fail; _, _, _, true -> fail") void free(final long address, final long bytes, final boolean huge, final boolean lock); @Override @Contract(pure = true) byte getByte(final long address); @Override @Contract(pure = true) short getShort(final long address); @Override @Contract(pure = true) int getInt(final long address); @Override @Contract(pure = true) long getLong(final long address); @Override @Contract(pure = true) byte getByteVolatile(final long address); @Override @Contract(pure = true) short getShortVolatile(final long address); @Override @Contract(pure = true) int getIntVolatile(final long address); @Override @Contract(pure = true) long getLongVolatile(final long address); @Override void putByte(final long address, final byte value); @Override void putShort(final long address, final short value); @Override void putInt(final long address, final int value); @Override void putLong(final long address, final long value); @Override void putByteVolatile(final long address, final byte value); @Override void putShortVolatile(final long address, final short value); @Override void putIntVolatile(final long address, final int value); @Override void putLongVolatile(final long address, final long value); @Override void get(final long src, int bytes, final @NotNull byte[] dest, final int offset); @Override void put(final long dest, int bytes, final @NotNull byte[] src, final int offset); }
UnsafeMemoryManager implements MemoryManager { @Override @Deprecated @Contract(value = "_ -> fail", pure = true) public long virt2phys(final long address) { if (!OPTIMIZED) { if (unsafe == null) throw new NullPointerException("The Unsafe object is not available."); if (address == 0) throw new IllegalArgumentException("The parameter 'address' MUST NOT be 0."); } throw new UnsupportedOperationException("The Unsafe object does not implement this operation."); } @SuppressWarnings({"NestedTryStatement", "UseOfSunClasses"})  UnsafeMemoryManager(); @Override @Deprecated @Contract(value = " -> fail", pure = true) long getHugepageSize(); @Override @Deprecated @SuppressWarnings("BooleanParameter") @Contract(value = "_, _, _ -> fail", pure = true) long mmap(final @NotNull File file, final boolean huge, final boolean lock); @Override @Deprecated @SuppressWarnings("BooleanParameter") @Contract(value = "_, _, _, _ -> fail", pure = true) void munmap(final long address, final @NotNull File file, final boolean huge, final boolean lock); @Override @Deprecated @Contract(value = "_ -> fail", pure = true) long virt2phys(final long address); @Override @Deprecated @SuppressWarnings("BooleanParameter") @Contract(value = "_, _, _ -> fail", pure = true) @NotNull DmaMemory dmaAllocate(final long bytes, final boolean huge, final boolean lock); @Override @Contract(pure = true) boolean isValid(); @Override @Contract(pure = true) int getAddressSize(); @Override @Contract(pure = true) long getPageSize(); @Override @SuppressWarnings("BooleanParameter") @Contract(value = "_, true, _ -> fail; _, _, true -> fail", pure = true) long allocate(final long bytes, final boolean huge, final boolean lock); @Override @SuppressWarnings("BooleanParameter") @Contract("_, _, true, _ -> fail; _, _, _, true -> fail") void free(final long address, final long bytes, final boolean huge, final boolean lock); @Override @Contract(pure = true) byte getByte(final long address); @Override @Contract(pure = true) short getShort(final long address); @Override @Contract(pure = true) int getInt(final long address); @Override @Contract(pure = true) long getLong(final long address); @Override @Contract(pure = true) byte getByteVolatile(final long address); @Override @Contract(pure = true) short getShortVolatile(final long address); @Override @Contract(pure = true) int getIntVolatile(final long address); @Override @Contract(pure = true) long getLongVolatile(final long address); @Override void putByte(final long address, final byte value); @Override void putShort(final long address, final short value); @Override void putInt(final long address, final int value); @Override void putLong(final long address, final long value); @Override void putByteVolatile(final long address, final byte value); @Override void putShortVolatile(final long address, final short value); @Override void putIntVolatile(final long address, final int value); @Override void putLongVolatile(final long address, final long value); @Override void get(final long src, int bytes, final @NotNull byte[] dest, final int offset); @Override void put(final long dest, int bytes, final @NotNull byte[] src, final int offset);  }