filprofiler
filprofiler copied to clipboard
New reentrancy strategy
Current system is complex, and may be causing #149 in part.
Proposal:
- Reentrancy checks happen in a new, custom Rust allocator wrapping existing allocators.
- mmap() would still be called by jemalloc, so that still needs reentrancy prevention logic similar to current one.
- Probably there are no calls to malloc() etc.. in current Rust code?
The hope is:
- C code (or more broadly defined, the API emulation layer) doesn't have to know about reentrancy.
- We only don't track allocations from Rust. Right now random other allocations become untracked in various scenarios.
- Existing invariants: We don't ever double count allocations (e.g. malloc() can call mmap()!).
- Existing invariants: No crashes/corruption due to reentrancy.