Different broadphase approach

I've written a dyn tree for a project I'm working on in C# wich was inspired by Box2D's. Looking at the source I got interested in trying a different broadphase approach. Box2D uses a buffer to store all moved proxies. Then makes a tree query for each to find candidates for contacts but those queries might return dublicates so the pairs have to be cached in another buffer and filtered using sort.

My approach which you can find here https://github.com/lithander/Box2D/ does store the information of moved proxies in the tree itself. It allows you to iterate over all overlapping pairs of proxies where at least one had moved. (this iteratioin also clears the 'touched' flag)

The pros are:
No dynamically growing Pair-Buffer or Move-Buffer (thus fewer memory allocations at runtime)
No sorting required to find dublicates
Less lines of code
Should be faster in large, dynamic scenes (e.g. "Tumbler" or "Add Pair Stresstest")

The cons:
There's a baseline cost proportional to the number of proxies whenever the number of moved proxies is > 0
? (im sure there are more)

I don't mean to imply my approach is better then the current one but for some it could be. I did it just for fun so don't critisize me too hard if I missed something obvious. (Not a Box2D user myself)
I am currently trying to reimplement the dynamic tree and broadphase from Box2D in Rust and have just read through the broadphase code. It seems that the pair buffer and the move buffer are both only ever growing. And while the pair duplicates are detected they still don't get deleted. I wonder why there isn't at least some kind of free list to reuse old indices like in the dynamic tree. I think it was probably benchmarked and the growing memory consumption was deemed insignificant, but still, to my untrained eye your implementation seems nicer and I am thinking of using it instead, so thanks for posting it!

EDIT: Actually, I was wrong, both buffers get reset in UpdatePairs.

Original thread: https://box2d.org/forum/viewtopic.php?t=10130