pisettings.h
Go to the documentation of this file.
1 
9 
10 #ifndef PISETTINGS_H
11 #define PISETTINGS_H
12 
13 /********************************************************************************
14  * GENERAL SETTINGS
15  ********************************************************************************/
16 
24 #define PERFORMANCES 0
25 
26 #if PERFORMANCES
27 
33 #define EXTREME_PERF 0
34 
43 #define INLINE_FUNCTIONS 1
44 
45 #endif
46 
53 #define DEEP_REMOVE 1
54 
55 /********************************************************************************
56  * MEMORY SETTINGS
57  ********************************************************************************/
58 
59 #if PERFORMANCES
60 #if EXTREME_PERF
61 
65 #define INITIAL_BLOCK_SIZE 134217728
66 #else
67 
71 #define INITIAL_BLOCK_SIZE 65536
72 #endif
73 #else
74 
78 #define INITIAL_BLOCK_SIZE 8
79 #endif
80 
85 #define INITIAL_BLOCKS 10000
86 
92 #define NEW_BLOCK_THRESHOLD 0.8
93 
94 // WARNING: if 0 the memory will always be dirty
95 #if PERFORMANCES
96 #if EXTREME_PERF
97 #define COLLECT_GARBAGE 0
98 #else
99 #define COLLECT_GARBAGE 1
100 #endif
101 #else
102 #define COLLECT_GARBAGE 1
103 #endif
104 
109 #define STACK_LIMIT 10000
110 
111 /********************************************************************************
112  * DEBUGGING
113  ********************************************************************************/
114 
119 #define PRINT_FREE_CELLS 1
120 
126 #define PRINT_ONLY_DANGLING_CELLS 1
127 
132 #define DEBUG_GARBAGE_COLLECTOR_MODE 0
133 
134 /********************************************************************************
135  * INIT
136  ********************************************************************************/
137 
138 // 0 => no checks about types nor errors, just segfaults => use ONLY when
139 // testing performances on correct programs
140 #if PERFORMANCES
141 
146 #define CHECKS 0
147 #else
148 
153 #define CHECKS 1
154 #endif
155 
156 /********************************************************************************
157  * FILES SETTINGS
158  ********************************************************************************/
159 
164 #define PI_COMPILE_FILE_NAME_PREFIX ".picompile"
165 
170 #define PI_COMPILER_FILE_NAME_PREFIX ".picompiler"
171 
176 #define REMOVE_TMP_FILES 1
177 
178 /********************************************************************************
179  * LIMITS
180  ********************************************************************************/
181 
186 #define MAX_TOK_LEN 512
187 
192 #define ERROR_MESSAGE_LEN 512
193 
199 #define N_BUILTIN_LAMBDA 50
200 
205 #define N_BUILTIN_MACRO 50
206 
207 /********************************************************************************
208  * CONSOLE ANSI COLORS
209  ********************************************************************************/
210 
211 #define ANSI_COLOR_BLACK "\x1b[0;30m"
212 #define ANSI_COLOR_BLUE "\x1b[0;34m"
213 #define ANSI_COLOR_GREEN "\x1b[0;32m"
214 #define ANSI_COLOR_CYAN "\x1b[0;36m"
215 #define ANSI_COLOR_RED "\x1b[0;31m"
216 #define ANSI_COLOR_PURPLE "\x1b[0;35m"
217 #define ANSI_COLOR_BROWN "\x1b[0;33m"
218 #define ANSI_COLOR_GRAY "\x1b[0;37m"
219 #define ANSI_COLOR_DARK_GRAY "\x1b[1;30m"
220 #define ANSI_COLOR_LIGHT_BLUE "\x1b[1;34m"
221 #define ANSI_COLOR_LIGHT_GREEN "\x1b[1;32m"
222 #define ANSI_COLOR_LIGHT_CYAN "\x1b[1;36m"
223 #define ANSI_COLOR_LIGHT_RED "\x1b[1;31m"
224 #define ANSI_COLOR_LIGHT_PURPLE "\x1b[1;35m"
225 #define ANSI_COLOR_YELLOW "\x1b[1;33m"
226 #define ANSI_COLOR_WHITE "\x1b[1;37m"
227 #define ANSI_COLOR_RESET "\x1b[0m"
228 #define COLOR1 ANSI_COLOR_LIGHT_BLUE
229 #define COLOR2 ANSI_COLOR_YELLOW
230 
231 #endif // !PISETTINGS_H
232