skip to content
[readonly]

The view heap's first-fit page allocator (meshd gives each loaded program its view from it)

sh
$ sexc add @ajax/mesh-view-alloc
  • total 3
  • drwxr-xr-x-../
  • drwxr-xr-x-Oct 27 05:23v/# 1 version
  • drwxr-xr-x-Oct 27 05:23files/# the files of 0.1.0
latest
0.1.0, published Oct 27 05:23 by ajax
owners
ajax
license
MIT
dependencies
@ajax/mesh-abi-view-heap ^0.1.0, @ajax/mesh-check ^0.1.0
dependents
@ajax/mesh-driver
keywords
mesh alphaos view heap allocator
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-view-alloc
repository
https://github.com/thomasdavis/alpha-c-mesh
==> 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.