1
我目前正在嘗試安裝一個嵌入式Rust項目。爲此,如果我可以使用collections
板條箱(以及由collections
所要求的擴展板,alloc
板條箱)將會很好。有沒有簡單的方法來實現這一目標?我目前在Cargo.toml使用收藏與貨物沒有stdlib
[build-dependencies]
gcc = "0.3"
[dependencies]
rust-libcore = "*"
[dependencies.rlibc]
git = "https://github.com/hackndev/rlibc"
branch = "zinc"
以下的依賴性和如下使用它們:
#![no_std]
#![crate_type="staticlib"]
#![feature(lang_items)]
#![feature(start)]
// This is not found when building with Cargo
extern crate collections;
//#[cfg(target_os = "none")]
extern crate rlibc;
#[start]
pub fn main(_argc: isize, _argv: *const *const u8) -> isize {
// or some call like this
core::collections::Vec::new();
0
}
有沒有一種簡單的方法包括collections
箱子?
您是否有一些底層分配器可用於嵌入式設備?我不知道jemalloc是否支持ARM,如果不支持,則必須有一些分配器可用。 – Shepmaster