From 2cb8f1308b653c0b02df263cebaf5f8d6b229d59 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Tue, 8 Nov 2011 11:14:30 +0000 Subject: [PATCH] tm::shadow() must take a validator --- transaction_manager.cc | 20 -------------------- transaction_manager.h | 1 - 2 files changed, 21 deletions(-) diff --git a/transaction_manager.cc b/transaction_manager.cc index 4743bba..85bc453 100644 --- a/transaction_manager.cc +++ b/transaction_manager.cc @@ -46,26 +46,6 @@ transaction_manager::new_block(validator v) return wr; } -// FIXME: make exception safe -pair -transaction_manager::shadow(block_address orig) -{ - if (is_shadow(orig) && - !sm_->count_possibly_greater_than_one(orig)) - return make_pair(bm_->write_lock(orig), false); - - read_ref src = bm_->read_lock(orig); - write_ref dest = bm_->write_lock_zero(sm_->new_block()); - ::memcpy(dest.data(), src.data(), MD_BLOCK_SIZE); - - ref_t count = sm_->get_count(orig); - if (count == 0) - throw runtime_error("shadowing free block"); - sm_->dec(orig); - add_shadow(dest.get_location()); - return make_pair(dest, count > 1); -} - // FIXME: duplicate code pair transaction_manager::shadow(block_address orig, validator v) diff --git a/transaction_manager.h b/transaction_manager.h index b86fb1a..b7d2236 100644 --- a/transaction_manager.h +++ b/transaction_manager.h @@ -33,7 +33,6 @@ namespace persistent_data { // shadowing returns a new write_ref, and a boolean which // indicates whether the children should be incremented. - std::pair shadow(block_address orig); std::pair shadow(block_address orig, validator v); read_ref read_lock(block_address b);