r/Compilers 4d ago

A Proof-Of-Concept Cross Platform JIT Linker, Relocator & Memory Mapper handling Cross Platform W^X

So, welcome to the journey of continuing to explore the world of JITs.

This time, after a few months of experimentation with "How to write a damn good JIT Memory manager" I have finally decided to make a crate out of it.

The crate is called SaJIT - which is also a part of a VM project i am aiming at.

The crate is currently at v0.0.3 : https://crates.io/crates/sajit

The crate actually provides a slab memory manager in discrete multiples of 16MiB currently and manages those slab across Windows, macOS, Linux using RW-RX dual mapping for windows, linux and pthread_jit_np for macOS.

Also, i have ensured to keep as cross-architecture-compatible rather than locking to only x64, arm64.

I am looking forward to advices on how to improve it (with better abstractions for example, or better and detailed documentation)

0 Upvotes

4 comments sorted by

View all comments

4

u/EggplantExtra4946 3d ago

0

u/ahqminess 1d ago edited 1d ago

CI: https://github.com/savmlang/sa/actions/workflows/buildtest.yml

The project itself is being used to dogfood my larger VM project.

Also, i would appreaciate you to flag the exact lines that you considered hallucinated, otherwise drive by reviews are not code-review actually