Test space_map_transactional
This commit is contained in:
@@ -24,8 +24,10 @@
|
||||
//----------------------------------------------------------------
|
||||
|
||||
namespace persistent_data {
|
||||
class core_map : public space_map {
|
||||
class core_map : public checked_space_map {
|
||||
public:
|
||||
typedef boost::shared_ptr<core_map> ptr;
|
||||
|
||||
core_map(block_address nr_blocks)
|
||||
: counts_(nr_blocks, 0),
|
||||
nr_free_(nr_blocks) {
|
||||
@@ -93,6 +95,20 @@ namespace persistent_data {
|
||||
throw std::runtime_error("not implemented");
|
||||
}
|
||||
|
||||
// FIXME: meaningless, but this class is only used for testing
|
||||
size_t root_size() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// FIXME: meaningless, but this class is only used for testing
|
||||
virtual void copy_root(void *dest, size_t len) const {
|
||||
throw std::runtime_error("not implemented");
|
||||
}
|
||||
|
||||
checked_space_map::ptr clone() const {
|
||||
return ptr(new core_map(*this));
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<ref_t> counts_;
|
||||
unsigned nr_free_;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
//----------------------------------------------------------------
|
||||
|
||||
namespace persistent_data {
|
||||
|
||||
|
||||
// FIXME: change name 'transactional' is so vague.
|
||||
|
||||
// This space map ensures no blocks are allocated which have been
|
||||
|
Reference in New Issue
Block a user