# memory-region

> memory-region, a magmalake tin: A region of bytes, on the heap or in a shared mapping, carved by a bump allocator that returns offsets rather than pointers, so whatever is built in it reads the same in any process that maps it.

[magmalake](https://magmalake.dev/) [memory-region](https://magmalake.dev/s/memory-region)

A region of bytes, on the heap or in a shared mapping, carved by a bump allocator that returns offsets rather than pointers, so whatever is built in it reads the same in any process that maps it.

Install

mojoshelf:

```
pixi shelf add memory-region-mojo
```

`pixi shelf` comes with mojoshelf: [install it first](https://mojoshelf.org/getting-started).

plain pixi:

```
pixi init app -c https://conda.modular.com/max -c conda-forge && cd app
sed -i.bak 's/^\[workspace\]/[workspace]\npreview = ["pixi-build"]/' pixi.toml
pixi add "mojo-compiler==1.2.0"
# Without mojoshelf: the tin as a git dependency at its published commit.
# Transitive dependencies may be wrong: pixi takes the tin's own git deps as
# pinned in its pixi.toml, which may not match what other tins pin, and then
# fails with "duplicate records". mojoshelf picks revisions that agree.
pixi add memory-region-mojo --git https://github.com/magmalake/memory-region.mojo --rev 40068c4f95ea659e9b78aa91ced45420b07e3e6e
```

No mojoshelf needed. If pixi reports duplicate records, the mojoshelf tab picks revisions that agree.

Version

`0.1.1` on mojoshelf

Source

[GitHub](https://github.com/magmalake/memory-region.mojo) [README](https://github.com/magmalake/memory-region.mojo#readme)

## Works today

- Heap and file-backed shared regions behind one bump allocator
- The consumer's mapping is read-only, with checked, origin-tracked views
- How Arrow batches cross processes without a copy

Checked against A write-here, read-there round trip between two mappings in one process

- [thrift](https://magmalake.dev/s/thrift) compact + binary protocol
- [zstd](https://magmalake.dev/s/zstd) libzstd
- [lz4](https://magmalake.dev/s/lz4) liblz4
- [brotli](https://magmalake.dev/s/brotli) libbrotli
- [snappy](https://magmalake.dev/s/snappy) pure Mojo
- [deflate](https://magmalake.dev/s/deflate) DEFLATE · gzip · pure Mojo
- [hashes](https://magmalake.dev/s/hashes) CRC-32 · murmur3 · XXH64
- [threads](https://magmalake.dev/s/threads) pthreads · atomics · parallel\_for
- [Every tin](https://magmalake.dev/tins)

[A magmalake project](https://magmalake.dev/)

Apache 2.0 · © 2026 Marius Seritan
