|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.caucho.hessian.util.HessianFreeList<T>
public final class HessianFreeList<T>
FreeList provides a simple class to manage free objects. This is useful for large data structures that otherwise would gobble up huge GC time.
The free list is bounded. Freeing an object when the list is full will do nothing.
Constructor Summary | |
---|---|
HessianFreeList(int size)
Create a new free list. |
Method Summary | |
---|---|
T |
allocate()
Try to get an object from the free list. |
boolean |
allowFree(T obj)
|
boolean |
checkDuplicate(T obj)
Debugging to see if the object has already been freed. |
boolean |
free(T obj)
Frees the object. |
void |
freeCareful(T obj)
Frees the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HessianFreeList(int size)
initialSize
- maximum number of free objects to store.Method Detail |
---|
public T allocate()
public boolean free(T obj)
obj
- the object to be freed.public boolean allowFree(T obj)
public void freeCareful(T obj)
obj
- the object to be freed.public boolean checkDuplicate(T obj)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |