WeakMemoryHolder (JNA API)
Description: declaration: package: com.sun.jna, class: WeakMemoryHolder

Package com.sun.jna

# Class WeakMemoryHolder

java.lang.Object
com.sun.jna.WeakMemoryHolder

public class WeakMemoryHolder extends Object
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

  Fields
  Modifier and Type
  Field
  Description
  `(package private) IdentityHashMap<Reference<Object>,Memory>`
  `backingMap`
  `(package private) ReferenceQueue<Object>`
  `referenceQueue`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WeakMemoryHolder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clean()`
  `void`
  `put(Object o, Memory m)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### referenceQueue

    ReferenceQueue<Object> referenceQueue

  - ### backingMap

    IdentityHashMap<Reference<Object>,Memory> backingMap

- ## Constructor Details

  - ### WeakMemoryHolder

    public WeakMemoryHolder()

- ## Method Details

  - ### put

    public void put(Object o, Memory m)

  - ### clean

    public void clean()