You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
The allocator interface is used to allocate chunks from an array. It is an empty generic package that can be instantiated with different predefined allocators. Any interface requiring an allocator will take an instance of the allocator package:
-- Allocator interfacegenerictype Context isprivate;
type Element_Range isrange <>;
withProcedureInitialize (Ctx : out Context:
Size : Element_Range);
withProcedureAllocate (Ctx : Context;
Length : Element_Range;
Start : out Element_Range);
withProcedureFree (Ctx : Context;
Start : Element_Range);
packageAllocator_GenericisendAllocator_Generic;
-- Allocator implementationpackageSimple_Allocatoristype Element_Range is Integer range0 .. Integer'Last;
type Context isrecord
Size : Element_Range;
...
endrecord;
procedureInitialize (Ctx : out Context
Size : Element_Range);
procedureAllocate (R : Element_Range;
S : out Element_Range;
L : out Element_Range);
procedureFree (R : Element_Range;
S : Element_Range);
packageAllocatorisnew Allocator_Generic (Element_Range, Initialize, Allocate, Free);
endSimple_Allocator;
-- Package using an arbitrary allocatorgenericwithpackageAllocator_Generic (<>);
packageBlock_AllocatorisendBlock_Allocator;
The allocator does not work on the payload data but only on a specified range and size. It can allocate from a list of arbitrary elements.
The text was updated successfully, but these errors were encountered:
The allocator interface is used to allocate chunks from an array. It is an empty generic package that can be instantiated with different predefined allocators. Any interface requiring an allocator will take an instance of the allocator package:
The allocator does not work on the payload data but only on a specified range and size. It can allocate from a list of arbitrary elements.
The text was updated successfully, but these errors were encountered: