Gecode::MemoryConfig Namespace Reference
[Space-memory management]
Parameters defining memory management policy for spaces. More...
Functions | |
void | align (size_t &s) |
Align size s to the required alignment. | |
Variables | |
const unsigned int | n_hc_cache = 4*4 |
How many heap chunks should be cached at most. | |
const size_t | hcsz_min = 1024 |
Minimal size of a heap chunk requested from the OS. | |
const size_t | hcsz_max = 32 * 1024 |
Maximal size of a heap chunk requested from the OS. | |
const int | hcsz_inc_ratio = 8 |
Increment ratio for chunk size. | |
const int | hcsz_dec_ratio = 8 |
Decrement ratio for chunk size. | |
const int | fl_unit_size = ((sizeof(void*) == 4) ? 2 : 3) |
Unit size for free lists. | |
const int | fl_size_min = ((sizeof(void*) == 4) ? 2 : 2) |
Minimal size for free list element. | |
const int | fl_size_max = ((sizeof(void*) == 4) ? 3 : 3) |
Maximal size for free list element. | |
const int | fl_refill = 8 |
Number of free lists elements to allocate. | |
const size_t | region_area_size = 32 * 1024 |
Size of region area. |
Detailed Description
Parameters defining memory management policy for spaces.
Function Documentation
void Gecode::MemoryConfig::align | ( | size_t & | s | ) | [inline] |
Align size s to the required alignment.
Definition at line 148 of file memory-config.hpp.
Variable Documentation
const unsigned int Gecode::MemoryConfig::n_hc_cache = 4*4 |
How many heap chunks should be cached at most.
Definition at line 51 of file memory-config.hpp.
const size_t Gecode::MemoryConfig::hcsz_min = 1024 |
Minimal size of a heap chunk requested from the OS.
Definition at line 56 of file memory-config.hpp.
const size_t Gecode::MemoryConfig::hcsz_max = 32 * 1024 |
Maximal size of a heap chunk requested from the OS.
Maximal is not strictly true, if a contiguous memory chunk is requested that exceeds hcsz_max, a chunk will be allocated that fits that request.
Definition at line 64 of file memory-config.hpp.
const int Gecode::MemoryConfig::hcsz_inc_ratio = 8 |
Increment ratio for chunk size.
If a space has requested hcsz_inc_ratio chunks of heap memory, the chunk size is doubled.
Definition at line 71 of file memory-config.hpp.
const int Gecode::MemoryConfig::hcsz_dec_ratio = 8 |
Decrement ratio for chunk size.
When a space is cloned, the new clone normally inherits the current chunk size from the original space. However, if the original space has requested less than hcsz_dec_ratio heap chunks of the current chunk size, the current chunk size for the clone is halfed.
Definition at line 81 of file memory-config.hpp.
const int Gecode::MemoryConfig::fl_unit_size = ((sizeof(void*) == 4) ? 2 : 3) |
Unit size for free lists.
The unit size (given as binary logarithm) defines how big a unit of memory for free lists is. Also, it defines the alignment. Sizes of free list objects must be multiples of the unit size.
Currently, for 32 bit machines, the unit size is 4 bytes. For 64 bit machines, it is 8 bytes.
Definition at line 94 of file memory-config.hpp.
const int Gecode::MemoryConfig::fl_size_min = ((sizeof(void*) == 4) ? 2 : 2) |
Minimal size for free list element.
The minimal size is given in the number of free list units.
Currently, for 32 bit machines, the minimal size is 8 bytes. For 64 bit machines, it is 16 bytes.
Definition at line 103 of file memory-config.hpp.
const int Gecode::MemoryConfig::fl_size_max = ((sizeof(void*) == 4) ? 3 : 3) |
Maximal size for free list element.
The maximal size is given in the number of free list units.
Currently, for 32 bit machines, the maximal size is 12 bytes. For 64 bit machines, it is 24 bytes.
Definition at line 112 of file memory-config.hpp.
const int Gecode::MemoryConfig::fl_refill = 8 |
Number of free lists elements to allocate.
When a request for a free list element can not be fulfilled, as the free list is empty and there is also no reusable memory available, allocate fl_refill free list elements.
Definition at line 120 of file memory-config.hpp.
const size_t Gecode::MemoryConfig::region_area_size = 32 * 1024 |
Size of region area.
The region area can be used in a stack fashion through access from a space. If the a request exceeds the current free space, memory will be allocated from the heap.
Definition at line 138 of file memory-config.hpp.