pub struct NeutralAllocPolicy;Expand description
Backend-neutral allocation policy useful for diagnostic dumps. Mirrors
the VM/WASM “pure non-alloc builtins” whitelist exactly so the
[no_alloc] annotation reads the same on both runtime backends.
Constructors with payloads are treated as allocating; nullary
constructors (Option.None, Result.Ok with primitive seed) are not.
Codegen pipelines should use the backend-specific policy
(VmAllocPolicy, WasmAllocPolicy); this type is for --emit-ir,
aver bench, and other tools that want a sensible answer without
committing to a target.
Trait Implementations§
Source§impl AllocPolicy for NeutralAllocPolicy
impl AllocPolicy for NeutralAllocPolicy
Source§fn builtin_allocates(&self, name: &str) -> bool
fn builtin_allocates(&self, name: &str) -> bool
Whether a call to a builtin (e.g.
List.prepend, Int.toString)
allocates a heap object on this backend.Auto Trait Implementations§
impl Freeze for NeutralAllocPolicy
impl RefUnwindSafe for NeutralAllocPolicy
impl Send for NeutralAllocPolicy
impl Sync for NeutralAllocPolicy
impl Unpin for NeutralAllocPolicy
impl UnsafeUnpin for NeutralAllocPolicy
impl UnwindSafe for NeutralAllocPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more