Generated on Sun Feb 17 15:24:26 2019 for Gecode by doxygen 1.6.3

config.hpp

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christian Schulte <schulte@gecode.org>
00005  *
00006  *  Bugfixes provided by:
00007  *     Zandra Norman
00008  *
00009  *  Copyright:
00010  *     Christian Schulte, 2008
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  Permission is hereby granted, free of charge, to any person obtaining
00017  *  a copy of this software and associated documentation files (the
00018  *  "Software"), to deal in the Software without restriction, including
00019  *  without limitation the rights to use, copy, modify, merge, publish,
00020  *  distribute, sublicense, and/or sell copies of the Software, and to
00021  *  permit persons to whom the Software is furnished to do so, subject to
00022  *  the following conditions:
00023  *
00024  *  The above copyright notice and this permission notice shall be
00025  *  included in all copies or substantial portions of the Software.
00026  *
00027  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00028  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00029  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00030  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00031  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00032  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00033  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00034  *
00035  */
00036 
00037 namespace Gecode { namespace Kernel {
00038 
00043   namespace MemoryConfig {
00047     const unsigned int n_hc_cache = 4*4;
00048 
00052     const size_t hcsz_min =  1024;
00060     const size_t hcsz_max = 32 * 1024;
00067     const int hcsz_inc_ratio = 8;
00077     const int hcsz_dec_ratio = 8;
00078 
00090     const int fl_unit_size = ((sizeof(void*) == 4) ? 2 : 3);
00099     const int fl_size_min  = ((sizeof(void*) == 4) ? 2 : 2);
00108     const int fl_size_max  = ((sizeof(void*) == 4) ? 3 : 3);
00116     const int fl_refill = 8;
00124 #ifndef GECODE_MEMORY_ALIGNMENT
00125 #define GECODE_MEMORY_ALIGNMENT static_cast<size_t>(8U)
00126 #endif
00127 
00134     const size_t region_area_size = 32 * 1024;
00135 
00137     void align(size_t& s, size_t a = GECODE_MEMORY_ALIGNMENT);
00138 
00139     /*
00140      * Alignment
00141      *
00142      */
00143     forceinline void
00144     align(size_t& s, size_t a) {
00145       s += ((a - (s & (a - 1))) & (a - 1));
00146     }
00147 
00148   }
00149 
00150 }}
00151 
00152 // STATISTICS: kernel-memory