← All compilation units

Flyology.Data_Structures.Allocation_Algorithms.Contract

Description

Complete persisted identity checked by the implementation.

Algorithm_Capabilities

Algorithm_Capabilities : Allocation_Algorithms.Allocation_Capabilities;

Algorithm_Configuration

type Algorithm_Configuration is private;

Algorithm_Identity

Algorithm_Identity : Layout_Identity;

Algorithm_Minimum_Block_Limit

Algorithm_Minimum_Block_Limit : Positive;

Algorithm_View

type Algorithm_View is limited private;

Attach

procedure Attach
  (Item          : out Algorithm_View;
   Region        : Region_View;
   Location      : Region_Offset;
   Configuration : Algorithm_Configuration;
   Instance_ID   : Interfaces.Unsigned_64)

Attach and validate an existing allocator.

Parameters
Item

View attached on success

Region

Attached caller-owned region

Location

Stored allocator location

Configuration

Expected algorithm-specific geometry

Instance_ID

Expected caller-selected identity

Attach_Allocation

procedure Attach_Allocation
  (Region : in out Region_View; Item : Algorithm_View; Value : Allocation_Algorithms.Allocation_Handle)

Attach a checked region view to one live allocation.

Parameters
Region

Allocation-region view attached on success

Item

Attached allocator view

Value

Live allocation handle

Bind_Allocation

function Bind_Allocation
  (Item      : Algorithm_View;
   Value     : Allocation_Algorithms.Allocation_Handle;
   Offset    : Byte_Count;
   Extent    : Byte_Count;
   Alignment : Byte_Count;
   Signature : Interfaces.Unsigned_64;
   Version   : Interfaces.Unsigned_32;
   Writable  : Boolean) return Immutable_Storage_View

Bind a checked allocation slice to immutable storage operations.

Parameters
Item

Attached allocator view

Value

Live allocation handle

Offset

Slice offset

Extent

Slice extent

Alignment

Required native alignment

Signature

Immutable representation signature

Version

Immutable representation version

Writable

Whether a builder may write unpublished bytes

Return value

Opaque checked immutable-storage binding @exclude

Block_Capacity

function Block_Capacity
  (Item : Algorithm_View; Value : Allocation_Algorithms.Allocation_Handle) return Byte_Count

Return the usable capacity of one live allocation.

Parameters
Item

Attached allocator view

Value

Live allocation handle

Return value

Usable allocation bytes

Capabilities

Capabilities : constant Allocation_Algorithms.Allocation_Capabilities := Algorithm_Capabilities;

Compile-time synchronization, placement, and search characteristics.

Configuration

subtype Configuration is Algorithm_Configuration;

Algorithm-specific immutable creation parameters.

Copy

procedure Copy
  (Item          : Algorithm_View;
   Source        : Allocation_Algorithms.Allocation_Handle;
   Source_Offset : Byte_Count;
   Target        : Allocation_Algorithms.Allocation_Handle;
   Target_Offset : Byte_Count;
   Length        : Byte_Count)

Copy between live allocation slices.

Parameters
Item

Attached allocator view

Source

Source allocation handle

Source_Offset

Source slice offset

Target

Target allocation handle

Target_Offset

Target slice offset

Length

Bytes to copy

Create_Or_Attach

procedure Create_Or_Attach
  (Item          : out Algorithm_View;
   Region        : Region_View;
   Location      : Region_Offset;
   Configuration : Algorithm_Configuration;
   Instance_ID   : Interfaces.Unsigned_64;
   Result        : out Open_Result)

Create in virgin storage or attach to an exact compatible allocator.

Parameters
Item

Attached view or detached during concurrent initialization

Region

Attached caller-owned region

Location

Stored allocator location

Configuration

Expected algorithm-specific geometry

Instance_ID

Expected nonzero caller-selected identity

Result

Creation, attachment, or in-progress outcome

Current_Metadata

function Current_Metadata (Item : Algorithm_View) return Allocation_Algorithms.Metadata

Return common immutable allocator metadata.

Parameters
Item

Attached allocator view

Return value

Capacity, minimum unit, identity, incarnation, and extent

Destroy

procedure Destroy (Item : in out Algorithm_View)

Destroy an empty quiescent allocator and detach Item.

Parameters
Item

Exclusively synchronized allocator view

Detach

procedure Detach (Item : in out Algorithm_View)

Detach a process-local view without modifying stored bytes.

Parameters
Item

View to detach

Identity

Identity : constant Layout_Identity := Algorithm_Identity;

Complete persisted identity checked by the implementation.

Implementation_Attach

procedure Implementation_Attach
  (Item          : out Algorithm_View;
   Region        : Region_View;
   Location      : Region_Offset;
   Configuration : Algorithm_Configuration;
   Instance_ID   : Interfaces.Unsigned_64)
Parameters
Item
Region
Location
Configuration
Instance_ID

Implementation_Attach_Allocation

procedure Implementation_Attach_Allocation
  (Region : in out Region_View; Item : Algorithm_View; Value : Allocation_Algorithms.Allocation_Handle)
Parameters
Region
Item
Value

Implementation_Bind_Allocation

function Implementation_Bind_Allocation
  (Item      : Algorithm_View;
   Value     : Allocation_Algorithms.Allocation_Handle;
   Offset    : Byte_Count;
   Extent    : Byte_Count;
   Alignment : Byte_Count;
   Signature : Interfaces.Unsigned_64;
   Version   : Interfaces.Unsigned_32;
   Writable  : Boolean) return Immutable_Storage_View
Parameters
Item
Value
Offset
Extent
Alignment
Signature
Version
Writable
Return value

Implementation_Block_Capacity

function Implementation_Block_Capacity
  (Item : Algorithm_View; Value : Allocation_Algorithms.Allocation_Handle) return Byte_Count
Parameters
Item
Value
Return value

Implementation_Copy

procedure Implementation_Copy
  (Item          : Algorithm_View;
   Source        : Allocation_Algorithms.Allocation_Handle;
   Source_Offset : Byte_Count;
   Target        : Allocation_Algorithms.Allocation_Handle;
   Target_Offset : Byte_Count;
   Length        : Byte_Count)
Parameters
Item
Source
Source_Offset
Target
Target_Offset
Length

Implementation_Create_Or_Attach

procedure Implementation_Create_Or_Attach
  (Item          : out Algorithm_View;
   Region        : Region_View;
   Location      : Region_Offset;
   Configuration : Algorithm_Configuration;
   Instance_ID   : Interfaces.Unsigned_64;
   Result        : out Open_Result)
Parameters
Item
Region
Location
Configuration
Instance_ID
Result

Implementation_Current_Metadata

function Implementation_Current_Metadata (Item : Algorithm_View) return Allocation_Algorithms.Metadata
Parameters
Item
Return value

Implementation_Destroy

procedure Implementation_Destroy (Item : in out Algorithm_View)
Parameters
Item

Implementation_Detach

procedure Implementation_Detach (Item : in out Algorithm_View)
Parameters
Item

Implementation_Initialize

procedure Implementation_Initialize
  (Item          : out Algorithm_View;
   Region        : Region_View;
   Location      : Region_Offset;
   Configuration : Algorithm_Configuration;
   Instance_ID   : Interfaces.Unsigned_64)
Parameters
Item
Region
Location
Configuration
Instance_ID

Implementation_Is_Attached

function Implementation_Is_Attached (Item : Algorithm_View) return Boolean
Parameters
Item
Return value

Implementation_Is_Poisoned

function Implementation_Is_Poisoned (Item : Algorithm_View) return Boolean
Parameters
Item
Return value

Implementation_Poison

procedure Implementation_Poison (Region : Region_View; Location : Region_Offset)
Parameters
Region
Location

Implementation_Read

procedure Implementation_Read
  (Item   : Algorithm_View;
   Value  : Allocation_Algorithms.Allocation_Handle;
   Offset : Byte_Count;
   Data   : out Ada.Streams.Stream_Element_Array)
Parameters
Item
Value
Offset
Data

Implementation_Release_Immediate

procedure Implementation_Release_Immediate
  (Item : in out Algorithm_View; Value : Allocation_Algorithms.Allocation_Handle)
Parameters
Item
Value

Implementation_Release_Timed

procedure Implementation_Release_Timed
  (Item    : in out Algorithm_View;
   Value   : Allocation_Algorithms.Allocation_Handle;
   Timeout : Wait_Timeout)
Parameters
Item
Value
Timeout

Implementation_Required_Storage

function Implementation_Required_Storage (Configuration : Algorithm_Configuration) return Byte_Count
Parameters
Configuration
Return value

Implementation_Try_Allocate_Immediate

procedure Implementation_Try_Allocate_Immediate
  (Item           : in out Algorithm_View;
   Requested_Size : Positive;
   Value          : out Allocation_Algorithms.Allocation_Handle;
   Result         : out Allocation_Algorithms.Allocation_Result)
Parameters
Item
Requested_Size
Value
Result

Implementation_Try_Allocate_Timed

procedure Implementation_Try_Allocate_Timed
  (Item           : in out Algorithm_View;
   Requested_Size : Positive;
   Timeout        : Wait_Timeout;
   Value          : out Allocation_Algorithms.Allocation_Handle;
   Result         : out Allocation_Algorithms.Allocation_Result)
Parameters
Item
Requested_Size
Timeout
Value
Result

Implementation_Write

procedure Implementation_Write
  (Item   : Algorithm_View;
   Value  : Allocation_Algorithms.Allocation_Handle;
   Offset : Byte_Count;
   Data   : Ada.Streams.Stream_Element_Array)
Parameters
Item
Value
Offset
Data

Initialize

procedure Initialize
  (Item          : out Algorithm_View;
   Region        : Region_View;
   Location      : Region_Offset;
   Configuration : Algorithm_Configuration;
   Instance_ID   : Interfaces.Unsigned_64)

Destructively initialize allocator storage.

Parameters
Item

View attached on success

Region

Attached caller-owned region

Location

Stored allocator location

Configuration

Algorithm-specific immutable geometry

Instance_ID

Nonzero caller-selected identity

Is_Attached

function Is_Attached (Item : Algorithm_View) return Boolean

Test whether a process-local view remains attached.

Parameters
Item

View to inspect

Return value

True while Item retains mapping information

Is_Poisoned

function Is_Poisoned (Item : Algorithm_View) return Boolean

Test the persisted poison lifecycle.

Parameters
Item

Attached allocator view

Return value

True only when explicitly poisoned

Minimum_Block_Limit

Minimum_Block_Limit : constant Positive := Algorithm_Minimum_Block_Limit;

Smallest allocation unit accepted by this implementation.

Poison

procedure Poison (Region : Region_View; Location : Region_Offset)

Poison after algorithm-specific external quiescence authorization.

Parameters
Region

Attached backing region

Location

Stored allocator location

Read

procedure Read
  (Item   : Algorithm_View;
   Value  : Allocation_Algorithms.Allocation_Handle;
   Offset : Byte_Count;
   Data   : out Ada.Streams.Stream_Element_Array)

Copy a live allocation slice into Data.

Parameters
Item

Attached allocator view

Value

Live allocation handle

Offset

Slice offset

Data

Destination bytes

Release

procedure Release (Item : in out Algorithm_View; Value : Allocation_Algorithms.Allocation_Handle)

Release one live allocation without waiting.

Parameters
Item

Attached allocator view

Value

Live allocation handle

Release

procedure Release
  (Item : in out Algorithm_View; Value : Allocation_Algorithms.Allocation_Handle; Timeout : Wait_Timeout)

Release one live allocation while waiting for metadata contention.

Parameters
Item

Attached allocator view

Value

Live allocation handle

Timeout

Maximum contention wait

Required_Storage

function Required_Storage (Configuration : Algorithm_Configuration) return Byte_Count

Compute the complete allocator extent.

Parameters
Configuration

Algorithm-specific immutable geometry

Return value

Complete metadata, padding, and payload extent

Try_Allocate

procedure Try_Allocate
  (Item           : in out Algorithm_View;
   Requested_Size : Positive;
   Value          : out Allocation_Algorithms.Allocation_Handle;
   Result         : out Allocation_Algorithms.Allocation_Result)

Attempt one allocation without waiting.

Parameters
Item

Attached allocator view

Requested_Size

Positive requested payload bytes

Value

New handle or Null_Allocation

Result

Allocation, exhaustion, or contention outcome

Try_Allocate

procedure Try_Allocate
  (Item           : in out Algorithm_View;
   Requested_Size : Positive;
   Timeout        : Wait_Timeout;
   Value          : out Allocation_Algorithms.Allocation_Handle;
   Result         : out Allocation_Algorithms.Allocation_Result)

Attempt allocation while waiting only for metadata contention.

Parameters
Item

Attached allocator view

Requested_Size

Positive requested payload bytes

Timeout

Maximum contention wait

Value

New handle or Null_Allocation

Result

Allocation or exhaustion outcome

View

subtype View is Algorithm_View;

Process-local allocator view.

Write

procedure Write
  (Item   : Algorithm_View;
   Value  : Allocation_Algorithms.Allocation_Handle;
   Offset : Byte_Count;
   Data   : Ada.Streams.Stream_Element_Array)

Copy Data into a live allocation slice.

Parameters
Item

Attached allocator view

Value

Live allocation handle

Offset

Slice offset

Data

Source bytes