Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
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
37namespace 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
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
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
#define GECODE_MEMORY_ALIGNMENT
Memory alignment.
Definition config.hpp:125
const int hcsz_inc_ratio
Increment ratio for chunk size.
Definition config.hpp:67
const size_t hcsz_max
Maximal size of a heap chunk requested from the OS.
Definition config.hpp:60
const int fl_size_max
Maximal size for free list element.
Definition config.hpp:108
void align(size_t &s, size_t a=GECODE_MEMORY_ALIGNMENT)
Align size s to the required alignment a.
Definition config.hpp:144
const int fl_unit_size
Unit size for free lists.
Definition config.hpp:90
const unsigned int n_hc_cache
How many heap chunks should be cached at most.
Definition config.hpp:47
const size_t hcsz_min
Minimal size of a heap chunk requested from the OS.
Definition config.hpp:52
const size_t region_area_size
Size of region area.
Definition config.hpp:134
const int fl_refill
Number of free lists elements to allocate.
Definition config.hpp:116
const int fl_size_min
Minimal size for free list element.
Definition config.hpp:99
const int hcsz_dec_ratio
Decrement ratio for chunk size.
Definition config.hpp:77
Gecode toplevel namespace
#define forceinline
Definition config.hpp:187