4 releases

0.2.0 Jan 24, 2022
0.1.0 Jan 19, 2022
0.1.0-beta.2 Jan 18, 2022

#402 in Memory management

44 downloads per month
Used in mos-hardware




Allocator for mos-unknown-none target (https://github.com/mrk-its/rust/tree/mos_target) and number of utilities for setting max heap size / checking free / used memory

API Docs



Full source code in examples/heap.rs.


extern crate alloc;
extern crate mos_alloc;

use alloc::{string::String, vec::Vec};

// ..

fn main(_argc: isize, _argv: *const *const u8) -> isize {
  // ..
  let text = String::from("foo");
  let data = (0..u16).collect::<Vec<_>>();

Running examples

The easiest way is to use provided devcontainer.json configuration for vscode:

  1. Configure Visual Studio Code with Remote - Containers extension
  2. Open this project inside devcontainer
  3. To build and run heap example on mos-sim 6502 simulator do:
    cargo run --example heap --release


All source code (including code snippets) is licensed under either of

at your option.

No runtime deps