Hasty Briefsbeta

Bilingual

Show HN: I built a Rust crate for running unsafe code safely

a year ago
  • #rust
  • #memory-isolation
  • #fork
  • mem-isolate runs functions in a forked process to ensure memory purity.
  • It uses POSIX fork() for isolation, leveraging copy-on-write memory techniques.
  • Supports Unix-like systems only (Linux, macOS, BSD); no Windows or wasm support.
  • Use cases include running leaky, unsafe, or heap-fragmenting code safely.
  • Overhead is ~1ms due to fork() and serialization, making it slower than direct calls.
  • Benchmarks show ~1.9ms for execute_in_isolated_process() vs. ~1.5ns for direct calls.
  • Dual-licensed under MIT or Apache 2.0.