Crate canic_memory

Crate canic_memory 

Source
Expand description

Core stable-memory utilities shared across Canic consumers.

This crate hosts the shared memory manager, eager TLS helpers, registry (ID/range reservation), and ergonomics macros (ic_memory!, ic_memory_range!, eager_static!) so external crates can coordinate stable memory without depending on the full canic stack.

Re-exports§

pub use manager::MEMORY_MANAGER;
pub use registry::MemoryRange;
pub use registry::MemoryRegistry;
pub use registry::MemoryRegistryEntry;
pub use registry::MemoryRegistryError;
pub use registry::MemoryRegistryView;
pub use registry::drain_pending_ranges;
pub use registry::drain_pending_registrations;
pub use runtime::init_eager_tls;
pub use ::canic_cdk as cdk;

Modules§

export
macros
manager
ops
registry
NOTE: All stable registry access is TLS-thread-local. This ensures atomicity on the IC’s single-threaded execution model.
runtime

Macros§

eager_init
Run $body during process start-up using ctor.
eager_static
Declare a thread-local static and schedule an eager initialization touch.
ic_memory
Declare a stable-memory slot backed by the Canic memory registry.
ic_memory_range
Reserve a contiguous block of stable-memory IDs for the current crate.