diff --git a/persistent-data/space-maps/careful_alloc.cc b/persistent-data/space-maps/careful_alloc.cc index 4e8560c..018590c 100644 --- a/persistent-data/space-maps/careful_alloc.cc +++ b/persistent-data/space-maps/careful_alloc.cc @@ -68,10 +68,10 @@ namespace { } virtual void dec(block_address b) { - sm_->dec(b); - - if (!sm_->get_count(b)) + if (sm_->get_count(b) == 1) mark_freed(b); + + sm_->dec(b); } virtual maybe_block find_free(span_iterator &it) {