Swap file implementation that can be used as a disk cache for arbitrary binary data.
Fixed-size blocks are allocated inside the swap file when a caller wants to write data.
The caller receives a handle to the allocated area based on which it can read the data
or free the area.
The implementation is thread-safe. I/O operations are performed in synchronized blocks,
only one thread would do a read or write at one moment.
Fixed-size blocks are allocated inside the swap file when a caller wants to write data. The caller receives a handle to the allocated area based on which it can read the data or free the area.
The implementation is thread-safe. I/O operations are performed in synchronized blocks, only one thread would do a read or write at one moment.