pub enum StorageClass {
Static,
Automatic,
Allocated,
Mapped,
Mmio,
Device,
Function,
Literal,
}Expand description
What kind of storage a memory safety instance is, which is class of
spec/safe-memory/04-safety-model.md section 4.1.
It is on meta_begin because judgement J4 writes it when the instance is created, and the
one place it is read afterwards is J6: free is permitted on an allocated instance and on
no other kind, which is what makes freeing a stack address a report rather than a crash in
the allocator.
Variants§
Static
A global or a static local, which lives as long as the program does.
Automatic
A local, which lives as long as its block does.
Allocated
Storage an allocator handed out, and the only kind free may be given.
Mapped
A mapping, from mmap or its equivalent.
Mmio
A device register window, where a read is not a read of anything the program wrote.
Device
Storage a device owns, which is what a DMA buffer is while the transfer runs.
Function
A function, which is what the address of one points at.
Literal
A string or compound literal, which the implementation may have merged with another.
Implementations§
Trait Implementations§
Source§impl Clone for StorageClass
impl Clone for StorageClass
Source§fn clone(&self) -> StorageClass
fn clone(&self) -> StorageClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more