main page
modules
namespaces
classes
files
Gecode home
Generated on Tue Mar 24 2020 14:04:04 for Gecode by
doxygen
1.8.17
gecode
kernel
memory
config.hpp
Go to the documentation of this file.
1
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
/*
3
* Main authors:
4
* Christian Schulte <schulte@gecode.org>
5
*
6
* Bugfixes provided by:
7
* Zandra Norman
8
*
9
* Copyright:
10
* Christian Schulte, 2008
11
*
12
* This file is part of Gecode, the generic constraint
13
* development environment:
14
* http://www.gecode.org
15
*
16
* Permission is hereby granted, free of charge, to any person obtaining
17
* a copy of this software and associated documentation files (the
18
* "Software"), to deal in the Software without restriction, including
19
* without limitation the rights to use, copy, modify, merge, publish,
20
* distribute, sublicense, and/or sell copies of the Software, and to
21
* permit persons to whom the Software is furnished to do so, subject to
22
* the following conditions:
23
*
24
* The above copyright notice and this permission notice shall be
25
* included in all copies or substantial portions of the Software.
26
*
27
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
31
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
32
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
33
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34
*
35
*/
36
37
namespace
Gecode
{
namespace
Kernel {
38
43
namespace
MemoryConfig {
47
const
unsigned
int
n_hc_cache
= 4*4;
48
52
const
size_t
hcsz_min
= 1024;
60
const
size_t
hcsz_max
= 32 * 1024;
67
const
int
hcsz_inc_ratio
= 8;
77
const
int
hcsz_dec_ratio
= 8;
78
90
const
int
fl_unit_size
= ((
sizeof
(
void
*) == 4) ? 2 : 3);
99
const
int
fl_size_min
= ((
sizeof
(
void
*) == 4) ? 2 : 2);
108
const
int
fl_size_max
= ((
sizeof
(
void
*) == 4) ? 3 : 3);
116
const
int
fl_refill
= 8;
124
#ifndef GECODE_MEMORY_ALIGNMENT
125
#define GECODE_MEMORY_ALIGNMENT static_cast<size_t>(8U)
126
#endif
127
134
const
size_t
region_area_size
= 32 * 1024;
135
137
void
align
(
size_t
& s,
size_t
a
=
GECODE_MEMORY_ALIGNMENT
);
138
139
/*
140
* Alignment
141
*
142
*/
143
forceinline
void
144
align
(
size_t
& s,
size_t
a
) {
145
s += ((
a
- (s & (
a
- 1))) & (
a
- 1));
146
}
147
148
}
149
150
}}
151
152
// STATISTICS: kernel-memory
Gecode::Kernel::MemoryConfig::region_area_size
const size_t region_area_size
Size of region area.
Definition:
config.hpp:134
Gecode::Kernel::MemoryConfig::hcsz_dec_ratio
const int hcsz_dec_ratio
Decrement ratio for chunk size.
Definition:
config.hpp:77
Gecode::Kernel::MemoryConfig::hcsz_inc_ratio
const int hcsz_inc_ratio
Increment ratio for chunk size.
Definition:
config.hpp:67
Gecode::Kernel::MemoryConfig::hcsz_min
const size_t hcsz_min
Minimal size of a heap chunk requested from the OS.
Definition:
config.hpp:52
Gecode::Kernel::MemoryConfig::fl_size_min
const int fl_size_min
Minimal size for free list element.
Definition:
config.hpp:99
Gecode
Gecode toplevel namespace
Gecode::Kernel::MemoryConfig::n_hc_cache
const unsigned int n_hc_cache
How many heap chunks should be cached at most.
Definition:
config.hpp:47
GECODE_MEMORY_ALIGNMENT
#define GECODE_MEMORY_ALIGNMENT
Memory alignment.
Definition:
config.hpp:125
Gecode::Kernel::MemoryConfig::hcsz_max
const size_t hcsz_max
Maximal size of a heap chunk requested from the OS.
Definition:
config.hpp:60
Gecode::Kernel::MemoryConfig::fl_unit_size
const int fl_unit_size
Unit size for free lists.
Definition:
config.hpp:90
Gecode::Kernel::MemoryConfig::align
void align(size_t &s, size_t a=GECODE_MEMORY_ALIGNMENT)
Align size s to the required alignment a.
Definition:
config.hpp:144
Gecode::Kernel::MemoryConfig::fl_size_max
const int fl_size_max
Maximal size for free list element.
Definition:
config.hpp:108
a
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
forceinline
#define forceinline
Definition:
config.hpp:185
Gecode::Kernel::MemoryConfig::fl_refill
const int fl_refill
Number of free lists elements to allocate.
Definition:
config.hpp:116