14 #ifndef STXXL_MNG_BLOCK_ALLOC_HEADER
15 #define STXXL_MNG_BLOCK_ALLOC_HEADER
36 int operator () (
int i)
const;
37 static const char * name();
52 diff = config::get_instance()->disks_number();
57 return begin + i % diff;
88 return "fully randomized striping";
120 return begin + (i + offset) % diff;
125 return "simple randomized striping";
134 std::vector<unsigned_type>
perm;
158 return begin + perm[i % diff];
163 return "randomized cycling striping";
172 RC_disk() :
RC(
config::get_instance()->regular_disk_range().first,
config::get_instance()->regular_disk_range().second)
177 return "Randomized cycling striping on regular disks";
191 return "Randomized cycling striping on flash devices";
213 return "single disk";
220 template <
class BaseAllocator_>
244 return base(offset + i);
258 #ifndef STXXL_DEFAULT_ALLOC_STRATEGY
259 #define STXXL_DEFAULT_ALLOC_STRATEGY stxxl::RC
266 #endif // !STXXL_MNG_BLOCK_ALLOC_HEADER
striping(unsigned_type b, unsigned_type e)
random_number< random_uniform_fast > rnd_type
Fully randomized disk allocation scheme functor.
void random_shuffle(ExtIterator_ first, ExtIterator_ last, RandomNumberGenerator_ &rand, unsigned_type M, AllocStrategy_ AS=STXXL_DEFAULT_ALLOC_STRATEGY())
External equivalent of std::random_shuffle.
SR(unsigned_type b, unsigned_type e)
Allocator functor adaptor.
random_number< random_uniform_fast > rnd_type
Example disk allocation scheme functor.
'Single disk' disk allocation scheme functor.
static const char * name()
RC_flash(unsigned_type b, unsigned_type e)
static const char * name()
static const char * name()
Randomized cycling disk allocation scheme functor.
choose_int_types< my_pointer_size >::int_type int_type
static const char * name()
Striping disk allocation scheme functor.
std::vector< unsigned_type > perm
#define STXXL_BEGIN_NAMESPACE
offset_allocator(const BaseAllocator_ &base_)
Creates functor based on instance of BaseAllocator_ functor.
int_type get_offset() const
offset_allocator(int_type offset_, const BaseAllocator_ &base_)
Creates functor based on instance of BaseAllocator_ functor with offset offset_.
Simple randomized disk allocation scheme functor.
void set_offset(int_type i)
static const char * name()
FR(unsigned_type b, unsigned_type e)
static const char * name()
choose_int_types< my_pointer_size >::unsigned_type unsigned_type
Access point to disks properties. Since 1.4.0: no config files are read automatically! ...
RC_disk(unsigned_type b, unsigned_type e)
RC(unsigned_type b, unsigned_type e)
#define _STXXL_FORCE_SEQUENTIAL
static const char * name()
offset_allocator()
Creates functor based on default BaseAllocator_ functor.
#define STXXL_END_NAMESPACE
single_disk(unsigned_type d, unsigned_type=0)