final class TransientNativeMemoryIO extends BoundedNativeMemoryIO
| Modifier and Type | Class and Description |
|---|---|
private static class |
TransientNativeMemoryIO.Magazine
Holder for a group of memory allocations.
|
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.ThreadLocal<java.lang.ref.Reference<TransientNativeMemoryIO.Magazine>> |
currentMagazine |
private static int |
PAGES_PER_MAGAZINE |
private static java.util.Map<TransientNativeMemoryIO.Magazine,java.lang.Boolean> |
referenceSet
Keeps strong references to the memory bucket until cleanup
|
private java.lang.Object |
sentinel |
ADDRESS_SIZE, IO, LONG_SIZE, parent, size| Modifier | Constructor and Description |
|---|---|
private |
TransientNativeMemoryIO(Ruby runtime,
java.lang.Object sentinel,
long address,
int size) |
| Modifier and Type | Method and Description |
|---|---|
private static long |
align(long offset,
long align) |
(package private) static MemoryIO |
allocateAligned(Ruby runtime,
int size,
int align,
boolean clear)
Allocates native memory, aligned to a minimum boundary.
|
array, arrayLength, arrayOffset, asByteBuffer, dup, equals, get, get, get, get, get, get, getAddress, getByte, getDouble, getFloat, getInt, getLong, getMemoryIO, getNativeLong, getRuntime, getShort, getZeroTerminatedByteArray, getZeroTerminatedByteArray, hashCode, indexOf, indexOf, order, put, put, put, put, put, put, putAddress, putByte, putDouble, putFloat, putInt, putLong, putMemoryIO, putNativeLong, putShort, putZeroTerminatedByteArray, setMemory, slice, sliceprivate static final java.util.Map<TransientNativeMemoryIO.Magazine,java.lang.Boolean> referenceSet
private static final java.lang.ThreadLocal<java.lang.ref.Reference<TransientNativeMemoryIO.Magazine>> currentMagazine
private static final int PAGES_PER_MAGAZINE
private final java.lang.Object sentinel
private TransientNativeMemoryIO(Ruby runtime, java.lang.Object sentinel, long address, int size)
static MemoryIO allocateAligned(Ruby runtime, int size, int align, boolean clear)
runtime - The Ruby runtimesize - The number of bytes to allocatealign - The minimum alignment of the memoryclear - Whether the memory should be cleared (zeroed)AllocatedDirectMemoryIOprivate static long align(long offset,
long align)