org.apache.cassandra.cache
Class RefCountedMemory

java.lang.Object
  extended by org.apache.cassandra.io.util.Memory
      extended by org.apache.cassandra.cache.RefCountedMemory

public class RefCountedMemory
extends Memory


Field Summary
 
Fields inherited from class org.apache.cassandra.io.util.Memory
peer
 
Constructor Summary
RefCountedMemory(long size)
           
 
Method Summary
 boolean reference()
           
 void unreference()
          decrement reference count.
 
Methods inherited from class org.apache.cassandra.io.util.Memory
allocate, equals, free, getByte, getBytes, getLong, setByte, setBytes, setLong, setMemory, size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RefCountedMemory

public RefCountedMemory(long size)
Method Detail

reference

public boolean reference()
Returns:
true if we succeed in referencing before the reference count reaches zero. (A FreeableMemory object is created with a reference count of one.)

unreference

public void unreference()
decrement reference count. if count reaches zero, the object is freed.



Copyright © 2013 The Apache Software Foundation