co.teapot

mmalloc

package mmalloc

Visibility
  1. Public
  2. All

Type Members

  1. trait Allocator extends AnyRef

    Manages memory and provides functions similar to C's standard library, including functions to allocate memory, extend an allocation, and free memory.

    Manages memory and provides functions similar to C's standard library, including functions to allocate memory, extend an allocation, and free memory. All "pointers" are byte offsets into data, a LargeMappedByteBuffer.

  2. trait LargeMappedByteBuffer extends AnyRef

    Memory maps a file and provides access to Ints and Longs.

    Memory maps a file and provides access to Ints and Longs. Any write operation automatically extends the length of the underlying file.

  3. class MMapByteBuffer extends LargeMappedByteBuffer

  4. class MemoryMappedAllocator extends Allocator

    Allocates memory backed by an underlying memory-mapped file.

    Allocates memory backed by an underlying memory-mapped file. If the given file is empty, initializes it. The file grows automatically as allocations are performed.

    For tuning performance, the parameter blockSize controls the unit of memory internally allocated. The parameter pieceSizes controls the granularity of allocations. When allocating k bytes, the allocator pads k up to the next element in pieceSizes, or to the next multiple of blockSize if k is larger than the largest element of pieceSizes. The array pieceSizes must be sorted, and the largest piece size must be smaller than blockSize by at least ~32 bytes (the minimum size of a PieceBlock header). If blockSize or pieceSizes are given when a file is first created, the same parameters must be used when MemoryMappedAllocator is constructed with the same file.

    This class is thread-safe (multiple threads may call the methods concurrently). (TODO: double-check thread-safety)

Value Members

  1. object MemoryMappedAllocator

Ungrouped