|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjeco.dmm.sim2.lib.freelist.FreeList
public class FreeList
Class that manages a region of memory. It is an atomic dynamic memory manager (ADM)
| Nested Class Summary | |
|---|---|
static class |
FreeList.ALLOCATION_MECHANISM
Fit algorithms: One ADM can manage blocks of different sizes, the block created depends on the object created: FIRST: FIRST_FIT BEST: BEST FIT EXACT: EXACT FIT FARTHEST: For reliability purposes, the farthest block to a given one |
static class |
FreeList.ALLOCATION_POLICY
|
static class |
FreeList.DATA_STRUCTURE
Data Structure used to manage free blocks |
| Field Summary | |
|---|---|
protected FreeList.ALLOCATION_MECHANISM |
allocationMechanism
Algorithm used to allocate memory |
protected FreeList.ALLOCATION_POLICY |
allocationPolicy
|
protected FreeList.DATA_STRUCTURE |
dataStructure
Data structure used to manage free blocks |
protected java.util.Collection<Block> |
freeBlocks
|
protected int |
index
|
protected long |
maxSizeInB
Max memory block size managed by this atomic (sizeInB <= maxSizeInB). |
protected Metrics |
metrics
|
protected long |
minSizeInB
Min memory block size managed by this atomic (minSizeInB < sizeInB). |
| Constructor Summary | |
|---|---|
FreeList(FreeList.DATA_STRUCTURE dataStructure,
FreeList.ALLOCATION_MECHANISM allocationMechanism,
FreeList.ALLOCATION_POLICY allocationPolicy,
long minSizeInB,
long maxSizeInB)
|
|
| Method Summary | |
|---|---|
boolean |
canManage(long sizeInB)
|
void |
free(Block block)
|
FreeList.ALLOCATION_MECHANISM |
getAllocationMechanism()
|
FreeList.ALLOCATION_POLICY |
getAllocationPolicy()
|
FreeList.DATA_STRUCTURE |
getDataStructure()
|
java.util.Collection<Block> |
getFreeBlocks()
|
int |
getIndex()
|
long |
getMaxSizeInB()
|
long |
getMinSizeInB()
|
Block |
malloc(long sizeInB,
Block hottest)
This function simulate the allocation operation. |
void |
removeBlockByPosition(long position)
|
void |
setIndex(int index)
|
void |
setMetrics(Metrics metrics)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Metrics metrics
protected int index
protected FreeList.ALLOCATION_MECHANISM allocationMechanism
protected FreeList.DATA_STRUCTURE dataStructure
protected FreeList.ALLOCATION_POLICY allocationPolicy
protected long minSizeInB
protected long maxSizeInB
protected java.util.Collection<Block> freeBlocks
| Constructor Detail |
|---|
public FreeList(FreeList.DATA_STRUCTURE dataStructure,
FreeList.ALLOCATION_MECHANISM allocationMechanism,
FreeList.ALLOCATION_POLICY allocationPolicy,
long minSizeInB,
long maxSizeInB)
| Method Detail |
|---|
public void setMetrics(Metrics metrics)
public int getIndex()
public void setIndex(int index)
public FreeList.ALLOCATION_MECHANISM getAllocationMechanism()
public FreeList.DATA_STRUCTURE getDataStructure()
public FreeList.ALLOCATION_POLICY getAllocationPolicy()
public long getMinSizeInB()
public long getMaxSizeInB()
public java.util.Collection<Block> getFreeBlocks()
public Block malloc(long sizeInB,
Block hottest)
sizeInB - Data size to be allocatedhottest - For reliability purposes, the hottest block
public void free(Block block)
public boolean canManage(long sizeInB)
public void removeBlockByPosition(long position)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||