CookMem 1.4.0
A C++ memory context / allocator
Loading...
Searching...
No Matches
config.h
1/*
2 * Copyright (c) 2021-2026 Heng Yuan
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef COOK_MEM_CONFIG_H
17#define COOK_MEM_CONFIG_H
18
19#include <cstddef>
20#include <cstdint>
21
22#include "version.h"
23
27namespace cookmem
28{
29
36const std::size_t ALLOCATION_ALIGNMENT = sizeof (std::size_t) * 2;
37
41const std::size_t DEFAULT_TRIM_EMPTY_SEGMENTS_INTERVAL = 4095;
46const std::size_t DEFAULT_IMMEDIATE_RELEASE_THRESHOLD = 256 * 1024;
52const std::size_t DEFAULT_MIN_SEGMENT_SIZE = 65536;
56const std::uint8_t DEFAULT_PADDING_SIZE = 0;
60const std::uint8_t MAX_PADDING_SIZE = 8;
64const char DEFAULT_PADDING_BYTE = (char)0xcd;
65
66} // namespace cookmem
67
68#ifndef COOKMEM_DEBUG
69#define COOKMEM_DEBUG 0
70#endif // COOKMEM_DEBUG
71
72#endif // COOK_MEM_CONFIG_H
Definition allocator.h:39
Definition allocator.h:29
const char DEFAULT_PADDING_BYTE
Definition config.h:64
const std::size_t DEFAULT_IMMEDIATE_RELEASE_THRESHOLD
Definition config.h:46
const std::size_t DEFAULT_TRIM_EMPTY_SEGMENTS_INTERVAL
Definition config.h:41
const std::uint8_t DEFAULT_PADDING_SIZE
Definition config.h:56
const std::uint8_t MAX_PADDING_SIZE
Definition config.h:60
const std::size_t DEFAULT_MIN_SEGMENT_SIZE
Definition config.h:52
const std::size_t ALLOCATION_ALIGNMENT
Definition config.h:36