Class SequentialAllocator

java.lang.Object
org.applecommander.os.SequentialAllocator

public class SequentialAllocator extends Object

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 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 for requestSize spaces between the used ranges. Returns either the first placement that the request will fit or a -1 if there is no fit.