#card10 #l0dable #cc-camp2019 #ccc #cc-camp19

nightly no-std card10-alloc

Dynamic memory allocation for card10 l0dables

2 releases

0.1.1 Sep 8, 2019
0.1.0 Sep 3, 2019

#408 in Memory management

MIT/Apache

19MB
197K SLoC

C 161K SLoC // 0.2% comments SWIG 9K SLoC // 0.2% comments M4 8K SLoC // 0.3% comments Shell 7.5K SLoC // 0.2% comments Visual Studio Project 5K SLoC GNU Style Assembly 2K SLoC // 0.2% comments Bitbake 1.5K SLoC // 0.3% comments Assembly 771 SLoC // 0.1% comments Arduino C++ 765 SLoC // 0.4% comments Automake 761 SLoC // 0.1% comments Python 169 SLoC // 0.4% comments Rust 160 SLoC // 0.0% comments Visual Studio Solution 139 SLoC Perl 96 SLoC // 0.2% comments INI 51 SLoC GDB Script 41 SLoC

Support for dynamically allocated memory

Reproduces l0dable hardware.c's _sbrk()

Unfortunately, we cannot link _sbrk()directly because it references the unwieldyerrno`.

Example

#![no_std]
#![no_main]

extern crate alloc;
use alloc::vec;
use card10_l0dable::*;

main!(main);
fn main() {
    // Pass stack headroom
    card10_alloc::init(128 * 1024);
    let mut xs = vec![];
    xs.push(23);
}

Dependencies