ic_memory/runtime/
policy.rs1use crate::{
2 MemoryManagerSlot, PolicyIdentity, PolicyIdentityError, RuntimeBootstrapPolicy, StableKey,
3};
4use std::convert::Infallible;
5
6pub struct GenericAllocationPolicy;
18
19impl RuntimeBootstrapPolicy for GenericAllocationPolicy {
20 type Error = Infallible;
21
22 fn validate_allocation(
23 &self,
24 _key: &StableKey,
25 _slot: &MemoryManagerSlot,
26 ) -> Result<(), Self::Error> {
27 Ok(())
28 }
29
30 fn runtime_bootstrap_identity(&self) -> Result<PolicyIdentity, PolicyIdentityError> {
31 PolicyIdentity::new("ic-memory.noop-policy", 1)
32 }
33}