'Context manager to temporarily disable flushing pending deallocation.
This can be nested.'

@contextlib.contextmanager
def disable(self):

    self._disable_count += 1
    try:
        (yield)
    finally:
        self._disable_count -= 1
        assert (self._disable_count >= 0)
