Minga.RenderModel.Window.RowSlotAllocator (Minga v0.1.0)

Copy Markdown View Source

Persistent producer-owned allocator for the 28-bit row slot field.

Slots are monotonic within {content_epoch, source_id, identity_kind} and a key keeps its slot for the epoch. Allocation never reuses removed keys.

Summary

Functions

Returns an existing slot or monotonically allocates one.

Creates an empty allocator.

Types

key()

@type key() :: term()

scope()

@type scope() :: {non_neg_integer(), non_neg_integer(), atom()}

slot()

@type slot() :: 0..268_435_455

t()

@type t() :: %Minga.RenderModel.Window.RowSlotAllocator{
  next: %{optional(scope()) => non_neg_integer()},
  slots: %{optional({scope(), key()}) => slot()}
}

Functions

allocate(allocator, scope, key)

@spec allocate(t(), scope(), key()) :: {:ok, slot(), t()} | :reset_required

Returns an existing slot or monotonically allocates one.

new()

@spec new() :: t()

Creates an empty allocator.