skip to content
==> README.md <==
1# @ajax/mesh-view-alloc
2
3The view heap's first-fit page allocator (meshd gives each loaded program its view from it).
4
5First-fit allocation over the view heap's VIEW_PAGES pages (programs.rs Heap). A view of 0 bytes takes no page (offset 0). Offsets are mailbox offsets. Freeing a free page is a bug in meshd: it aborts, as the Rust panics.
6
7```c
8#include "mesh/view_alloc.h"
9```
10
11## Ported from
12
13[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/programs.rs: `Heap` (alloc, free, free_pages, largest_run), `pages`.
14
15## Tests
16
17- `tests/view_alloc.c`: programs.rs's `heap_first_fit` and `heap_double_free` (the abort is checked in a child process).
18
19## Licence
20
21MIT. See the repository's LICENSE.