16 #ifndef FOXXLL_MNG_BLOCK_ALLOC_STRATEGY_INTERLEAVED_HEADER 17 #define FOXXLL_MNG_BLOCK_ALLOC_STRATEGY_INTERLEAVED_HEADER 26 #define CHECK_RUN_BOUNDS(pos) 36 : nruns_(nruns), begin_disk_(begin_disk), diff_(diff)
41 : nruns_(nruns), begin_disk_(strategy.begin_), diff_(strategy.diff_)
46 return begin_disk_ + (i /
nruns_) % diff_;
52 mutable std::default_random_engine rng_ { std::random_device { } () };
71 std::default_random_engine rng { std::random_device { } () };
72 for (
int i = 0; i < nruns; i++)
73 offsets_.push_back(rng() %
diff_);
84 std::vector<std::vector<size_t> >
perms_;
90 for (
int i = 0; i < nruns; i++)
92 for (
size_t j = 0; j <
diff_; j++)
95 std::random_shuffle(perms_[i].begin(), perms_[i].end());
117 template <
typename scheme>
167 #endif // !FOXXLL_MNG_BLOCK_ALLOC_STRATEGY_INTERLEAVED_HEADER
interleaved_striping(int nruns, const striping &strategy)
interleaved_random_cyclic(int nruns, const random_cyclic &strategy)
first_disk_only(int nruns, const single_disk &strategy)
interleaved_fully_random(int nruns, const fully_random &strategy)
std::vector< size_t > offsets_
size_t operator()(size_t i) const
std::vector< T, Allocator< T > > vector
vector with Manager tracking
std::vector< std::vector< size_t > > perms_
interleaved_simple_random(int nruns, const simple_random &strategy)
interleaved_striping(int nruns, size_t begin_disk, size_t diff)