Class TransientNativeMemory
java.lang.Object
jnr.ffi.Pointer
jnr.ffi.provider.AbstractMemoryIO
jnr.ffi.provider.jffi.DirectMemoryIO
jnr.ffi.provider.jffi.TransientNativeMemory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classHolder for a group of memory allocations.private static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThreadLocal<TransientNativeMemory.Magazine> private static final intprivate static final Map<TransientNativeMemory.Magazine, Boolean> Keeps strong references to the magazine until cleanupprivate final TransientNativeMemory.Sentinelprivate final longFields inherited from class DirectMemoryIO
IO -
Constructor Summary
ConstructorsConstructorDescriptionTransientNativeMemory(Runtime runtime, TransientNativeMemory.Sentinel sentinel, long address, long size) -
Method Summary
Modifier and TypeMethodDescriptionprivate static longalign(long offset, long align) static DirectMemoryIOstatic DirectMemoryIOfinal voiddispose()booleaninthashCode()longsize()Gets the size of this memory object in bytes (optional operation).Methods inherited from class DirectMemoryIO
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, transferFrom, transferToMethods inherited from class AbstractMemoryIO
checkBounds, checkBounds, getAddress, getInt, getLong, getNativeLong, indexOf, putAddress, putAddress, putInt, putLong, putNativeLong, slice, sliceMethods inherited from class Pointer
address, get, getNullTerminatedPointerArray, getNullTerminatedStringArray, getRuntime, isDirect, newIntPointer, put, toString, wrap, wrap, wrap
-
Field Details
-
referenceSet
Keeps strong references to the magazine until cleanup -
currentMagazine
-
PAGES_PER_MAGAZINE
private static final int PAGES_PER_MAGAZINE- See Also:
-
sentinel
-
size
private final long size
-
-
Constructor Details
-
TransientNativeMemory
TransientNativeMemory(Runtime runtime, TransientNativeMemory.Sentinel sentinel, long address, long size)
-
-
Method Details
-
allocate
-
allocate
-
align
private static long align(long offset, long align) -
size
public long size()Description copied from class:PointerGets the size of this memory object in bytes (optional operation).- Overrides:
sizein classDirectMemoryIO- Returns:
- the size of the memory area this
Pointerpoints to. If the size is unknown,Long.MAX_VALUEis returned}.
-
hashCode
public int hashCode()- Overrides:
hashCodein classDirectMemoryIO
-
equals
- Overrides:
equalsin classDirectMemoryIO
-
dispose
public final void dispose()
-