jeco.dmm.sim2.lib.allocator
Class SegregatedFreeList

java.lang.Object
  extended by jeco.dmm.sim2.lib.allocator.Allocator
      extended by jeco.dmm.sim2.lib.allocator.SegregatedFreeList
Direct Known Subclasses:
SegregatedFit, SimpleSegregatedStorage

public class SegregatedFreeList
extends Allocator

Important notes: we can omit header information. It is only useful for maintaining the free-blocks sortered in every ADM. This information is lost when the block in allocated. Since we are keeping the internal structure of ADMS by simulation, we do not have to take into account his kind of headers.

Author:
jlrisco

Field Summary
 
Fields inherited from class jeco.dmm.sim2.lib.allocator.Allocator
allowCoalescing, allowSplitting, freeLists, maxSizeInB, metrics, minSizeInB
 
Constructor Summary
SegregatedFreeList(long minSizeInB, long maxSizeInB, boolean allowSplitting, boolean allowCoalescing)
           
 
Method Summary
 Block malloc(long sizeInB, Block hottest)
          We just enter here if we are sure that this allocator is the correct one.
 void setup(FreeList.DATA_STRUCTURE dataStructure, FreeList.ALLOCATION_MECHANISM fitAlgorithm, FreeList.ALLOCATION_POLICY policy)
           
 
Methods inherited from class jeco.dmm.sim2.lib.allocator.Allocator
add, canManage, getFreeLists, getMaxSizeInB, getMinSizeInB, isAllowCoalescing, isAllowSplitting, setMaxSizeInB, setMetrics, setMinSizeInB
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SegregatedFreeList

public SegregatedFreeList(long minSizeInB,
                          long maxSizeInB,
                          boolean allowSplitting,
                          boolean allowCoalescing)
Method Detail

setup

public void setup(FreeList.DATA_STRUCTURE dataStructure,
                  FreeList.ALLOCATION_MECHANISM fitAlgorithm,
                  FreeList.ALLOCATION_POLICY policy)
Specified by:
setup in class Allocator

malloc

public Block malloc(long sizeInB,
                    Block hottest)
We just enter here if we are sure that this allocator is the correct one.

Specified by:
malloc in class Allocator
Parameters:
sizeInB - Size in bytes
hottest - For reliability purposes, the hottest block
Returns:
The block created