Record which segments are free and don't walk them (objects in these segments are dead).
If a buffered segment has a pending pop, don't scan or walk objects beyond the address that's going to be popped to (these objects are also dead).
Don't try to do a lightweight pop to an address that's not in the segment attached to the buffer -- the segment being popped to (and any other segments on the stack in between) are now dead, and the only way to mark them as being dead is to do a heavyweight pop.
Copied from Perforce
Change: 187224
ServerID: perforce.ravenbrook.com