pub struct MemoryAllocationPool { /* private fields */ }Expand description
MemoryAllocationPool
One host-wide pool over usable application IDs 10..=254. Governance IDs 0..=9 remain excluded. Explicit additional exclusions retain physical custody for unmanaged users; namespace grants never partition this pool.
The pool is immutable bootstrap policy, not durable allocation state. Current, omitted, reserved and retired ledger records independently retain their IDs. It is not inferred from application bytes or slot contents.
Implementations§
Source§impl MemoryAllocationPool
impl MemoryAllocationPool
Sourcepub fn new(
authorities: Vec<MemoryAuthority>,
exclusions: Vec<MemoryManagerIdRange>,
) -> Result<Self, MemoryAllocationPoolError>
pub fn new( authorities: Vec<MemoryAuthority>, exclusions: Vec<MemoryManagerIdRange>, ) -> Result<Self, MemoryAllocationPoolError>
Canonicalize host grants and physical exclusions before bootstrap.
§Panics
Panics only if an internal bounded-ID canonicalization invariant is broken.
Current owner grants, in canonical namespace order.
Sourcepub fn excluded_ranges(&self) -> &[MemoryManagerIdRange]
pub fn excluded_ranges(&self) -> &[MemoryManagerIdRange]
Physical exclusions including the permanent governance reservation.
Validate current key ownership independently of numeric placement.
Sourcepub fn validate_id(&self, id: u8) -> Result<(), MemoryAllocationPoolError>
pub fn validate_id(&self, id: u8) -> Result<(), MemoryAllocationPoolError>
Validate physical eligibility without granting ownership of a key.