org.apache.cassandra.cache
Class FreeableMemory

java.lang.Object
  extended by com.sun.jna.Pointer
      extended by com.sun.jna.Memory
          extended by org.apache.cassandra.cache.FreeableMemory

public class FreeableMemory
extends com.sun.jna.Memory


Field Summary
 
Fields inherited from class com.sun.jna.Memory
size
 
Fields inherited from class com.sun.jna.Pointer
NULL, peer, SIZE
 
Constructor Summary
FreeableMemory(long size)
           
 
Method Summary
protected  void finalize()
          avoid re-freeing already-freed memory
 byte getValidByte(long offset)
           
 boolean reference()
           
 void unreference()
          decrement reference count.
 
Methods inherited from class com.sun.jna.Memory
align, boundsCheck, clear, free, getByte, getByteBuffer, getChar, getDouble, getFloat, getInt, getLong, getPointer, getShort, getSize, getString, isValid, malloc, purge, read, read, read, read, read, read, read, setByte, setChar, setDouble, setFloat, setInt, setLong, setPointer, setShort, setString, share, share, size, toString, valid, write, write, write, write, write, write, write
 
Methods inherited from class com.sun.jna.Pointer
clear, createConstant, createConstant, equals, getByteArray, getCharArray, getDoubleArray, getFloatArray, getIntArray, getLongArray, getNativeLong, getPointerArray, getPointerArray, getShortArray, getString, getStringArray, getStringArray, getStringArray, getStringArray, hashCode, indexOf, nativeValue, nativeValue, read, setMemory, setNativeLong, setString, write
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FreeableMemory

public FreeableMemory(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.


finalize

protected void finalize()
avoid re-freeing already-freed memory

Overrides:
finalize in class com.sun.jna.Memory

getValidByte

public byte getValidByte(long offset)


Copyright © 2011 The Apache Software Foundation