diff --git a/persistent-data/space-maps/recursive.cc b/persistent-data/space-maps/recursive.cc index dadbe88..0977e61 100644 --- a/persistent-data/space-maps/recursive.cc +++ b/persistent-data/space-maps/recursive.cc @@ -97,6 +97,12 @@ namespace { add_op(b, block_op(SET, c)); else { recursing_lock lock(*this); + + // the inner set_count may trigger a find_free, + // so it's important we update the allocated + // blocks list before calling. + allocated_blocks_.add(b, b + 1); + return sm_->set_count(b, c); } } @@ -111,6 +117,12 @@ namespace { add_op(b, block_op(INC, count)); else { recursing_lock lock(*this); + + // the inner inc() may trigger a find_free, + // so it's important we update the allocated + // blocks list before calling. + allocated_blocks_.add(b, b + 1); + return sm_->inc(b, count); } }