Skip to content

Allocation to use mmap#180

Open
skx wants to merge 3 commits into
mainfrom
allocation
Open

Allocation to use mmap#180
skx wants to merge 3 commits into
mainfrom
allocation

Conversation

@skx

@skx skx commented Jul 13, 2026

Copy link
Copy Markdown
Owner

This pull-request moves from using a null area in the BSS section (8Gb) for our memory allocation to using mmap to allocate an area of RAM at startup (16gb).

In order to make this transition I first created a general-purpose "allocate" routine and moved all code to use that. Then updated it to use mmap as the backing store, and added bound checking to it

The plus side is this works. The downside is that performance seems to be very variable:

$ time ./inception brainfuck.lisp --main
Loading .. brainfuck.lisp
Hello World!

real	1m13.950s
user	0m6.069s
sys	0m2.647s

$ time ./inception brainfuck.lisp --main
Loading .. brainfuck.lisp
Hello World!

real	2m42.343s
user	0m7.437s
sys	0m4.618s

$ time ./inception brainfuck.lisp --main
Loading .. brainfuck.lisp
Hello World!

real	1m22.966s
user	0m6.954s
sys	0m3.189s

Need to investigate before merging, and compare to main and/or the previous release.

skx added 3 commits July 13, 2026 22:33
This ensures that we have a stable internal API; next up move to
MMAP.
This works, but it is painfully slow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant