Package org.h2.test.store
Class FreeSpaceList
java.lang.Object
org.h2.test.store.FreeSpaceList
A list that maintains ranges of free space (in blocks).
-
Constructor Summary
Constructors -
Method Summary
-
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 byteslength- the number of bytes
-
free
public void free(long pos, int length) Mark the space as free.- Parameters:
pos- the position in byteslength- the number of bytes
-
toString
-