Top Description Fields Constructors Methods
com.sun.jna

public Class WeakMemoryHolder

extends Object
Class Inheritance
Imports
java.lang.ref.Reference, .ReferenceQueue, .WeakReference, java.util.IdentityHashMap

Helper to hold a memory object based on the lifetime of another object. The intended use is to assoziate a ByteBuffer with its backing Memory object. The ByteBuffer is held by a WeakReference and a ReferenceQueue is used to track GC of the ByteBuffer. The references to the memory objects are released on access of WeakMemoryHolder.

Field Summary

Modifier and TypeField and Description
pack-priv IdentityHashMap<Reference<Object>, Memory>
pack-priv ReferenceQueue<Object>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized void
public synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

backingMapback to summary
pack-priv IdentityHashMap<Reference<Object>, Memory> backingMap
referenceQueueback to summary
pack-priv ReferenceQueue<Object> referenceQueue

Constructor Detail

WeakMemoryHolderback to summary
public WeakMemoryHolder()

Method Detail

cleanback to summary
public synchronized void clean()
putback to summary
public synchronized void put(Object o, Memory m)