OpenFPM_pdata
4.1.0
Project that contain the implementation of distributed structures
Loading...
Searching...
No Matches
map_vector_grow_p.hpp
1
/*
2
* Packer_cls.hpp
3
*
4
* Created on: Jul 15, 2015
5
* Author: i-bird
6
*/
7
8
#ifndef MAP_VECTOR_GROW_POLICY_HPP_
9
#define MAP_VECTOR_GROW_POLICY_HPP_
10
11
#define PAGE_ALLOC 1
12
13
namespace
openfpm
14
{
15
22
class
grow_policy_identity
23
{
24
public
:
25
34
static
size_t
grow
(
size_t
original,
size_t
requested)
35
{
36
return
requested;
37
}
38
};
39
46
class
grow_policy_double
47
{
48
public
:
49
58
static
size_t
grow
(
size_t
original,
size_t
requested)
59
{
60
size_t
grow
= (original == 0)?1:original;
61
while
(
grow
< requested) {
grow
*= 2;}
62
return
grow
;
63
}
64
};
65
67
typedef
grow_policy_double
vector_grow_policy_default
;
68
75
class
grow_policy_page
76
{
77
public
:
78
87
static
size_t
grow
(
size_t
original,
size_t
requested)
88
{
89
return
(requested / PAGE_ALLOC) * PAGE_ALLOC + PAGE_ALLOC;
90
}
91
};
92
}
93
94
#endif
/* MAP_VECTOR_GROW_POLICY_HPP_ */
openfpm::grow_policy_double
Grow policy define how the vector should grow every time we exceed the size.
Definition
map_vector_grow_p.hpp:47
openfpm::grow_policy_double::grow
static size_t grow(size_t original, size_t requested)
It say how much the vector must grow.
Definition
map_vector_grow_p.hpp:58
openfpm::grow_policy_identity
Grow policy define how the vector should grow every time we exceed the size.
Definition
map_vector_grow_p.hpp:23
openfpm::grow_policy_identity::grow
static size_t grow(size_t original, size_t requested)
It say how much the vector must grow.
Definition
map_vector_grow_p.hpp:34
openfpm::grow_policy_page
Grow policy define how the vector should grow every time we exceed the size.
Definition
map_vector_grow_p.hpp:76
openfpm::grow_policy_page::grow
static size_t grow(size_t original, size_t requested)
It say how much the vector must grow.
Definition
map_vector_grow_p.hpp:87
openfpm
convert a type into constant type
Definition
aggregate.hpp:293
openfpm::vector_grow_policy_default
grow_policy_double vector_grow_policy_default
default grow policy
Definition
map_vector_grow_p.hpp:67
openfpm_data
src
Vector
map_vector_grow_p.hpp
Generated by
1.9.8