jeco.dmm.sim2.lib.allocator
Class Allocator
java.lang.Object
jeco.dmm.sim2.lib.allocator.Allocator
- Direct Known Subclasses:
- SegregatedFreeList
public abstract class Allocator
- extends java.lang.Object
- Author:
- jlrisco
Constructor Summary |
Allocator(long minSizeInB,
long maxSizeInB,
boolean allowSplitting,
boolean allowCoalescing)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
metrics
protected Metrics metrics
minSizeInB
protected long minSizeInB
- Min memory block size managed by this allocator (minSizeInB < sizeInB).
maxSizeInB
protected long maxSizeInB
- Max memory block size managed by this allocator (sizeInB <= maxSizeInB).
freeLists
protected java.util.ArrayList<FreeList> freeLists
allowSplitting
protected boolean allowSplitting
allowCoalescing
protected boolean allowCoalescing
Allocator
public Allocator(long minSizeInB,
long maxSizeInB,
boolean allowSplitting,
boolean allowCoalescing)
setMetrics
public void setMetrics(Metrics metrics)
getMinSizeInB
public long getMinSizeInB()
setMinSizeInB
public void setMinSizeInB(long minSizeInB)
getMaxSizeInB
public long getMaxSizeInB()
setMaxSizeInB
public void setMaxSizeInB(long maxSizeInB)
getFreeLists
public java.util.ArrayList<FreeList> getFreeLists()
isAllowSplitting
public boolean isAllowSplitting()
isAllowCoalescing
public boolean isAllowCoalescing()
add
public void add(FreeList freeList)
canManage
public boolean canManage(long sizeInB)
setup
public abstract void setup(FreeList.DATA_STRUCTURE dataStructure,
FreeList.ALLOCATION_MECHANISM allocationMechanism,
FreeList.ALLOCATION_POLICY allocationPolicy)
malloc
public abstract Block malloc(long sizeInB,
Block hottest)
- Typical malloc allocation.
- Parameters:
sizeInB
- sizeInB Size in byteshottest
- For reliability purposes, the hottest block
- Returns:
- The block created