Class FreeSpaceList

java.lang.Object
org.h2.test.store.FreeSpaceList

public class FreeSpaceList extends Object
A list that maintains ranges of free space (in blocks).
  • Constructor Details

    • FreeSpaceList

      public FreeSpaceList(int firstFreeBlock, int blockSize)
  • Method Details

    • clear

      public void clear()
      Reset the list.
    • allocate

      public long allocate(int length)
      Allocate a number of blocks and mark them as used.
      Parameters:
      length - the number of bytes to allocate
      Returns:
      the start position in bytes
    • markUsed

      public void markUsed(long pos, int length)
      Mark the space as in use.
      Parameters:
      pos - the position in bytes
      length - the number of bytes
    • free

      public void free(long pos, int length)
      Mark the space as free.
      Parameters:
      pos - the position in bytes
      length - the number of bytes
    • toString

      public String toString()
      Overrides:
      toString in class Object