Class SequentialAllocator
java.lang.Object
org.applecommander.os.SequentialAllocator
The SequentialAllocator is intended to handle what is, essentially, a single dimension allocation. That is, if the disk is allocated by sequential chunks, this allocator should support it. For images that use T/S geometry instead of block geometry, the T/S will need to be transformed.
For instance, GameDOS allocates by T/S but allocates all in a chunk. So once there is a starting place, the rest of the file follows in a very specific order.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUsed(int first, int last) voidaddUsedByLength(int first, int length) intfind(int requestSize) Look forrequestSizespaces between the used ranges.
-
Constructor Details
-
SequentialAllocator
public SequentialAllocator(int totalSize)
-
-
Method Details
-
addUsed
public void addUsed(int first, int last) -
addUsedByLength
public void addUsedByLength(int first, int length) -
find
public int find(int requestSize) Look forrequestSizespaces between the used ranges. Returns either the first placement that the request will fit or a-1if there is no fit.
-