Real life has delayed my looking at this, and likely will continue delaying me for at least another week or two.
That said, there’s enough invariant asserts that, if there is a bug, it will be noticed quite rapidly, if anyone has the guts to try it before I get back to it. I’d give the code at least 45% chance of working out-of-the-gate (maybe 60%, excluding obvious typo-style bugs that are caught by the invariants).
There's even functions to dump the internal state into easily-read, one-line-per-allocation state.
Maybe I put too much effort into code to double-check stuff. Then I hit a problem and I realize putting the debug helper code in ended up saving time. The more difficult an issue would be to debug, the more time I put into debug helpers.
A first few self-tests are now successful. Real life still going to delay my saying this is ready, but at least temporary allocations are seeming to work fairly smoothly.
Progress is made. Temporary and long-lived allocations are both working.
Next up is to validate mixed-allocations, which primarily involves coming up with some test cases that may be interestings, and confirming the results match manually-calculated expectations.
Sometimes the time spent adding debugging-friendly APIs really pays off. As a result of my having those built-in from the start, I was able to quickly put together a number of unit tests to validate the functionality, find a bunch of bugs (sometimes in my test), and be ready to mark this essentially “done”.
Reasonably full description is in the PR:
This has been rebased against the current main branch, so should be a simple merge.