public class TransientNativeMemory extends DirectMemoryIO
Modifier and Type | Class and Description |
---|---|
private static class |
TransientNativeMemory.Magazine
Holder for a group of memory allocations.
|
private static class |
TransientNativeMemory.Sentinel |
Modifier and Type | Field and Description |
---|---|
private static java.lang.ThreadLocal<TransientNativeMemory.Magazine> |
currentMagazine |
private static int |
PAGES_PER_MAGAZINE |
private static java.util.Map<TransientNativeMemory.Magazine,java.lang.Boolean> |
referenceSet
Keeps strong references to the magazine until cleanup
|
private TransientNativeMemory.Sentinel |
sentinel |
private int |
size |
IO
Constructor and Description |
---|
TransientNativeMemory(Runtime runtime,
TransientNativeMemory.Sentinel sentinel,
long address,
int size) |
Modifier and Type | Method and Description |
---|---|
private static long |
align(long offset,
long align) |
static DirectMemoryIO |
allocate(Runtime runtime,
int size,
int align,
boolean clear) |
void |
dispose() |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
long |
size()
Gets the size of this memory object in bytes (optional operation).
|
array, arrayLength, arrayOffset, get, get, get, get, get, get, getByte, getDouble, getFloat, getInt, getLongLong, getPointer, getPointer, getShort, getString, getString, hasArray, indexOf, put, put, put, put, put, put, putByte, putDouble, putFloat, putInt, putLongLong, putPointer, putShort, putString, putZeroTerminatedByteArray, setMemory
checkBounds, checkBounds, getAddress, getInt, getLong, getNativeLong, indexOf, putAddress, putAddress, putInt, putLong, putNativeLong, slice, slice, transferFrom, transferTo
address, get, getNullTerminatedPointerArray, getNullTerminatedStringArray, getRuntime, isDirect, newIntPointer, put, toString, wrap, wrap, wrap
private static final java.util.Map<TransientNativeMemory.Magazine,java.lang.Boolean> referenceSet
private static final java.lang.ThreadLocal<TransientNativeMemory.Magazine> currentMagazine
private static final int PAGES_PER_MAGAZINE
private final TransientNativeMemory.Sentinel sentinel
private final int size
TransientNativeMemory(Runtime runtime, TransientNativeMemory.Sentinel sentinel, long address, int size)
public static DirectMemoryIO allocate(Runtime runtime, int size, int align, boolean clear)
private static long align(long offset, long align)
public long size()
Pointer
size
in class DirectMemoryIO
Pointer
points to. If
the size is unknown, Long.MAX_VALUE
is returned}.public int hashCode()
hashCode
in class DirectMemoryIO
public boolean equals(java.lang.Object obj)
equals
in class DirectMemoryIO
public final void dispose()