Rust allocator backed by ESP-IDF
This is a memory allocator for Rust, backed by the ESP-IDF.
This is intended to be used on an ESP32, linked against the ESP-IDF. For more information see:
- https://github.com/ctron/rust-esp-container/
- https://github.com/ctron/rust-esp-template
- https://github.com/MabezDev/rust-xtensa.git
- https://quickhack.net/nom/blog/2019-05-14-build-rust-environment-for-esp32.html
Usage
Add the following to your main, application project:
extern crate esp_idf_alloc;
static A: EspIdfAllocator = EspIdfAllocator;
Error handler
If you use a custom global allocator in your application, you will also need an error handler.
The following code will use the ESP-IDF abort()
method to handle the error:
use Layout;
extern "C"
!
Using with alloc
Also be sure to link in the alloc
create, as you might want this. Add the following to your Xargo.toml
:
[]
={}