… | |
… | |
22 | */ |
22 | */ |
23 | |
23 | |
24 | #ifndef UTIL_H__ |
24 | #ifndef UTIL_H__ |
25 | #define UTIL_H__ |
25 | #define UTIL_H__ |
26 | |
26 | |
27 | #include <compiler.h> |
|
|
28 | |
|
|
29 | #define DEBUG_POISON 0x00 // poison memory before freeing it if != 0 |
27 | #define DEBUG_POISON 0x00 // poison memory before freeing it if != 0 |
30 | #define DEBUG_SALLOC 0 // add a debug wrapper around all sallocs |
28 | #define DEBUG_SALLOC 0 // add a debug wrapper around all sallocs |
31 | #define PREFER_MALLOC 0 // use malloc and not the slice allocator |
29 | #define PREFER_MALLOC 0 // use malloc and not the slice allocator |
32 | |
30 | |
33 | #include <pthread.h> |
31 | #include <pthread.h> |
… | |
… | |
41 | |
39 | |
42 | #include <flat_hash_map.hpp> |
40 | #include <flat_hash_map.hpp> |
43 | |
41 | |
44 | #include <shstr.h> |
42 | #include <shstr.h> |
45 | #include <traits.h> |
43 | #include <traits.h> |
|
|
44 | |
|
|
45 | #include "ecb.h" |
46 | |
46 | |
47 | #if DEBUG_SALLOC |
47 | #if DEBUG_SALLOC |
48 | # define g_slice_alloc0(s) debug_slice_alloc0(s) |
48 | # define g_slice_alloc0(s) debug_slice_alloc0(s) |
49 | # define g_slice_alloc(s) debug_slice_alloc(s) |
49 | # define g_slice_alloc(s) debug_slice_alloc(s) |
50 | # define g_slice_free1(s,p) debug_slice_free1(s,p) |
50 | # define g_slice_free1(s,p) debug_slice_free1(s,p) |