-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvoltron.txt
153 lines (146 loc) · 4.24 KB
/
voltron.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Used by voltron.py
# Comments start with hash , but there are 3 exceptions : #include #ifdef #endif
# First 3 lines are mandatory : source_path output_header and namespace
# Then they have to be followed by [HEADER] [SYSTEM_LIBRARIES] and then [INCLUSIONS]
# All inclusions in your source files will be ignored. Therefore SYSTEM_LIBRARIES shall have all you need.
source_path=./include/
output_header=./llmalloc.h
# Namespace is optional / you can leave it as blank
namespace=llmalloc
####################################################
[HEADER]
/*
LLMALLOC VERSION 1.0.1
MIT License
Copyright (c) 2025 Akin Ocal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Acknowledgements:
This project uses a cosmetically modified version of Erik Rigtorp's lock-free queue implementation,
available at https://github.com/rigtorp/MPMCQueue, which is licenced under the MIT License.
*/
####################################################
[SYSTEM_LIBRARIES]
# THE PARTS BELOW WILL BE COPIED AS IS TO THE BEGINNING OF THE GENERATED FILE
####################################################
// STD C
#include <atomic>
#include <cstddef>
#include <cstdint>
#include <cmath>
#include <cassert>
#include <cstring>
#include <cctype>
#include <cstdlib>
// STD
#include <type_traits>
#include <array>
#include <string_view>
#include <new>
#ifdef ENABLE_PMR
#include <memory_resource>
#endif
#ifdef ENABLE_OVERRIDE
#include <stdexcept>
#endif
// CPU INTRINSICS
#include <immintrin.h>
#if defined(_MSC_VER)
#include <intrin.h>
#elif defined(__GNUC__)
#include <emmintrin.h>
#endif
// LINUX
#ifdef __linux__
#include <unistd.h>
#include <sys/mman.h>
#include <pthread.h>
#include <sched.h>
#include <fcntl.h>
#ifdef ENABLE_OVERRIDE
#include <limits.h>
#include <dlfcn.h>
#include <errno.h>
#endif
#ifdef ENABLE_NUMA
#include <numa.h>
#include <numaif.h>
#endif
#endif
// WINDOWS
#ifdef _WIN32
#include <windows.h>
#include <fibersapi.h>
#include <chrono>
#include <thread>
#endif
// TRACES
#if defined(ENABLE_PERF_TRACES) || defined(DISPLAY_ENV_VARS) || !defined(NDEBUG)
#include <cstdio>
#endif
// UNIT TESTS
#ifdef UNIT_TEST
#include <string>
#include <cstdio>
#endif
####################################################
[INCLUSIONS]
# LIST OF FILES , ORDER MATTERS AS THEY MAY HAVE INTERNAL DEPENDENCIES :
####################################################
#CHECKS FIRST
compiler/checks.h
cpu/architecture_check.h
os/os_check.h
#THEN THE REST
#COMPILER LAYER
compiler/builtin_functions.h
compiler/hints_branch_predictor.h
compiler/hints_hot_code.h
compiler/packed.h
compiler/unused.h
#CPU LAYER
cpu/alignment_constants.h
cpu/pause.h
#OS LAYER
os/assert_msg.h
os/virtual_memory.h
os/thread_local_storage.h
os/thread_utilities.h
os/environment_variable.h
#UTILITIES LAYER
utilities/alignment_and_size_utils.h
utilities/userspace_spinlock.h
utilities/lockable.h
utilities/bounded_queue.h
utilities/mpmc_bounded_queue.h
utilities/murmur_hash3.h
utilities/mpmc_dictionary.h
utilities/dictionary.h
# ALLOCATOR FRAMEWORK
arena.h
logical_page_header.h
logical_page.h
segment.h
scalable_allocator.h
heap_pow2.h
heap_pool.h
# THREAD CACHING MEMORY POOL
scalable_pool.h
# SINGLE THREADED ALLOCATOR
single_threaded_allocator.h
# THREAD CACHING MALLOC
scalable_malloc.h
scalable_malloc_overrides.h