heapless — Crate 詳細
heapless
Mature no_std
ヒープ無し(固定容量)で使えるコレクション(Vec/String/Deque/Map 等)を提供する crate。no_std 環境でのメモリ使用量を静的に制御しやすい。
Heapless, fixed-capacity data structures for no_std environments.
コード例
容量が型に埋め込まれるため、最大メモリ量を把握しやすいです。
#![no_std]
use heapless::Vec;
pub fn push_values() { let mut v: Vec<u8, 8> = Vec::new(); let _ = v.push(1); let _ = v.push(2);}