final class AllocatedNativeMemoryIO extends BoundedNativeMemoryIO implements AllocatedDirectMemoryIO
| Modifier and Type | Class and Description |
|---|---|
private static class |
AllocatedNativeMemoryIO.AllocationGroup
Holder for a group of memory allocations.
|
private static class |
AllocatedNativeMemoryIO.MemoryAllocation
Represents a single native memory allocation
|
| Modifier and Type | Field and Description |
|---|---|
private AllocatedNativeMemoryIO.MemoryAllocation |
allocation |
private static java.lang.ThreadLocal<java.lang.ref.Reference<AllocatedNativeMemoryIO.AllocationGroup>> |
currentBucket |
private static java.util.Map<AllocatedNativeMemoryIO.AllocationGroup,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 |
AllocatedNativeMemoryIO(Ruby runtime,
java.lang.Object sentinel,
long address,
int size,
int align) |
| Modifier and Type | Method and Description |
|---|---|
(package private) static AllocatedNativeMemoryIO |
allocate(Ruby runtime,
int size,
boolean clear)
Allocates native memory
|
(package private) static AllocatedNativeMemoryIO |
allocateAligned(Ruby runtime,
int size,
int align,
boolean clear)
Allocates native memory, aligned to a minimum boundary.
|
void |
free() |
boolean |
isAutoRelease() |
void |
setAutoRelease(boolean autorelease) |
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<AllocatedNativeMemoryIO.AllocationGroup,java.lang.Boolean> referenceSet
private static final java.lang.ThreadLocal<java.lang.ref.Reference<AllocatedNativeMemoryIO.AllocationGroup>> currentBucket
private final AllocatedNativeMemoryIO.MemoryAllocation allocation
private final java.lang.Object sentinel
private AllocatedNativeMemoryIO(Ruby runtime, java.lang.Object sentinel, long address, int size, int align)
static final AllocatedNativeMemoryIO allocate(Ruby runtime, int size, boolean clear)
runtime - The Ruby runtimesize - The number of bytes to allocateclear - Whether the memory should be cleared (zeroed)AllocatedDirectMemoryIOstatic AllocatedNativeMemoryIO 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)AllocatedDirectMemoryIOpublic void free()
free in interface AllocatedDirectMemoryIOpublic void setAutoRelease(boolean autorelease)
setAutoRelease in interface AllocatedDirectMemoryIOpublic boolean isAutoRelease()
isAutoRelease in interface AllocatedDirectMemoryIO