Skip navigation links
JNA API 4.5.2

Class WeakMemoryHolder

  • public class WeakMemoryHolder
    extends java.lang.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

      Modifier and Type Field and Description
      (package private) java.util.IdentityHashMap<java.lang.ref.Reference<java.lang.Object>,Memory> backingMap 
      (package private) java.lang.ref.ReferenceQueue<java.lang.Object> referenceQueue 
    • Constructor Summary

      Constructor and Description
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void clean() 
      void put(java.lang.Object o, Memory m) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • referenceQueue

        java.lang.ref.ReferenceQueue<java.lang.Object> referenceQueue
      • backingMap

        java.util.IdentityHashMap<java.lang.ref.Reference<java.lang.Object>,Memory> backingMap
    • Constructor Detail

      • WeakMemoryHolder

        public WeakMemoryHolder()
    • Method Detail

      • put

        public void put(java.lang.Object o,
                        Memory m)
      • clean

        public void clean()
JNA API 4.5.2

Copyright © 2007-2017 Timothy Wall. All Rights Reserved.