A debugging allocator that turns use-after-free and buffer overruns into immediate crashes by giving each allocation its own pages.
Make one with get_unmapping_allocator and use it with push_allocator around the code you suspect. Needs a system with virtual memory: macOS, Linux, Android or Windows.
Returns an allocator, backed by the current one for its records, that gives every allocation its own pages. The pages end at an inaccessible guard page, so running off the end crashes at once, and a freed block is made read-only, so writing through a stale pointer crashes too. It is slow and uses a page or more per allocation; free it with deinit_unmapping_allocator.