Generated on for Gecode by doxygen 1.17.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.dev>
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.dev
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#ifndef GECODE_FREELIST_SIZE_MAX32
38#define GECODE_FREELIST_SIZE_MAX32 3
39#endif
40#ifndef GECODE_FREELIST_SIZE_MAX64
41#define GECODE_FREELIST_SIZE_MAX64 3
42#endif
43
44namespace Gecode { namespace Kernel {
45
50 namespace MemoryConfig {
54 const unsigned int n_hc_cache = 4*4;
55
59 const size_t hcsz_min = 1024;
67 const size_t hcsz_max = 32 * 1024;
74 const int hcsz_inc_ratio = 8;
84 const int hcsz_dec_ratio = 8;
85
97 const int fl_unit_size = ((sizeof(void*) == 4) ? 2 : 3);
106 const int fl_size_min = ((sizeof(void*) == 4) ? 2 : 2);
123 const int fl_refill = 8;
131#ifndef GECODE_MEMORY_ALIGNMENT
132#define GECODE_MEMORY_ALIGNMENT static_cast<size_t>(8U)
133#endif
141 const size_t region_area_size = 32 * 1024;
142
144 void align(size_t& s, size_t a = GECODE_MEMORY_ALIGNMENT);
145
146 /*
147 * Alignment
148 *
149 */
150 forceinline void
151 align(size_t& s, size_t a) {
152 s += ((a - (s & (a - 1))) & (a - 1));
153 }
154
155 }
156
157}}
158
159// STATISTICS: kernel-memory
#define GECODE_FREELIST_SIZE_MAX64
Definition config.hpp:41
#define GECODE_MEMORY_ALIGNMENT
Memory alignment.
Definition config.hpp:132
#define GECODE_FREELIST_SIZE_MAX32
Definition config.hpp:38
Parameters defining memory management policy for spaces.
Definition config.hpp:50
const int hcsz_inc_ratio
Increment ratio for chunk size.
Definition config.hpp:74
const size_t hcsz_max
Maximal size of a heap chunk requested from the OS.
Definition config.hpp:67
const int fl_size_max
Maximal size for free list element.
Definition config.hpp:115
void align(size_t &s, size_t a=GECODE_MEMORY_ALIGNMENT)
Align size s to the required alignment a.
Definition config.hpp:151
const int fl_unit_size
Unit size for free lists.
Definition config.hpp:97
const unsigned int n_hc_cache
How many heap chunks should be cached at most.
Definition config.hpp:54
const size_t hcsz_min
Minimal size of a heap chunk requested from the OS.
Definition config.hpp:59
const size_t region_area_size
Size of region area.
Definition config.hpp:141
const int fl_refill
Number of free lists elements to allocate.
Definition config.hpp:123
const int fl_size_min
Minimal size for free list element.
Definition config.hpp:106
const int hcsz_dec_ratio
Decrement ratio for chunk size.
Definition config.hpp:84
Gecode toplevel namespace