Class Allocator<T>
java.lang.Object
gov.nih.mipav.view.renderer.WildMagic.Poisson.Octree.Allocator<T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()getState()This method returns the memory state of the allocator.T[]newElements(int elements) This method returns a pointer to an array of elements objects.(package private) voidreset()This method is the allocators destructor.voidrollBack()This method rolls back the allocator so that it makes all of the memory previously allocated available for re-allocation.voidrollBack(AllocatorState state) This method rolls back the allocator to the previous memory state and makes all of the memory previously allocated available for re-allocation.voidset(int blockSize) This method initiallizes the constructor and the blockSize variable specifies the the number of objects that should be pre-allocated at a time.
-
Field Details
-
blockSize
int blockSize -
index
int index -
remains
int remains -
memory
-
-
Constructor Details
-
Allocator
public Allocator()
-
-
Method Details
-
dispose
public void dispose() -
reset
void reset()This method is the allocators destructor. It frees up any of the memory that it has allocated. -
getState
This method returns the memory state of the allocator. -
rollBack
public void rollBack()This method rolls back the allocator so that it makes all of the memory previously allocated available for re-allocation. Note that it does it not call the constructor again, so after this method has been called, assumptions about the state of the values in memory are no longer valid. -
rollBack
This method rolls back the allocator to the previous memory state and makes all of the memory previously allocated available for re-allocation. Note that it does it not call the constructor again, so after this method has been called, assumptions about the state of the values in memory are no longer valid. -
set
public void set(int blockSize) This method initiallizes the constructor and the blockSize variable specifies the the number of objects that should be pre-allocated at a time. -
newElements
This method returns a pointer to an array of elements objects. If there is left over pre-allocated memory, this method simply returns a pointer to the next free piece of memory, otherwise it pre-allocates more memory. Note that if the number of objects requested is larger than the value blockSize with which the allocator was initialized, the request for memory will fail.
-