]>
git.proxmox.com Git - rustc.git/blob - src/jemalloc/include/jemalloc/jemalloc_macros.h.in
7 #define JEMALLOC_VERSION "@jemalloc_version@"
8 #define JEMALLOC_VERSION_MAJOR @jemalloc_version_major@
9 #define JEMALLOC_VERSION_MINOR @jemalloc_version_minor@
10 #define JEMALLOC_VERSION_BUGFIX @jemalloc_version_bugfix@
11 #define JEMALLOC_VERSION_NREV @jemalloc_version_nrev@
12 #define JEMALLOC_VERSION_GID "@jemalloc_version_gid@"
14 # define MALLOCX_LG_ALIGN(la) ((int)(la))
15 # if LG_SIZEOF_PTR == 2
16 # define MALLOCX_ALIGN(a) ((int)(ffs((int)(a))-1))
18 # define MALLOCX_ALIGN(a) \
19 ((int)(((size_t)(a) < (size_t)INT_MAX) ? ffs((int)(a))-1 : \
20 ffs((int)(((size_t)(a))>>32))+31))
22 # define MALLOCX_ZERO ((int)0x40)
24 * Bias tcache index bits so that 0 encodes "automatic tcache management", and 1
25 * encodes MALLOCX_TCACHE_NONE.
27 # define MALLOCX_TCACHE(tc) ((int)(((tc)+2) << 8))
28 # define MALLOCX_TCACHE_NONE MALLOCX_TCACHE(-1)
30 * Bias arena index bits so that 0 encodes "use an automatically chosen arena".
32 # define MALLOCX_ARENA(a) ((((int)(a))+1) << 20)
34 #if defined(__cplusplus) && defined(JEMALLOC_USE_CXX_THROW)
35 # define JEMALLOC_CXX_THROW throw()
37 # define JEMALLOC_CXX_THROW
41 # define JEMALLOC_ATTR(s)
42 # define JEMALLOC_ALIGNED(s) __declspec(align(s))
43 # define JEMALLOC_ALLOC_SIZE(s)
44 # define JEMALLOC_ALLOC_SIZE2(s1, s2)
45 # ifndef JEMALLOC_EXPORT
47 # define JEMALLOC_EXPORT __declspec(dllexport)
49 # define JEMALLOC_EXPORT __declspec(dllimport)
52 # define JEMALLOC_FORMAT_PRINTF(s, i)
53 # define JEMALLOC_NOINLINE __declspec(noinline)
55 # define JEMALLOC_NOTHROW __declspec(nothrow)
57 # define JEMALLOC_NOTHROW
59 # define JEMALLOC_SECTION(s) __declspec(allocate(s))
60 # define JEMALLOC_RESTRICT_RETURN __declspec(restrict)
61 # if _MSC_VER >= 1900 && !defined(__EDG__)
62 # define JEMALLOC_ALLOCATOR __declspec(allocator)
64 # define JEMALLOC_ALLOCATOR
66 #elif defined(JEMALLOC_HAVE_ATTR)
67 # define JEMALLOC_ATTR(s) __attribute__((s))
68 # define JEMALLOC_ALIGNED(s) JEMALLOC_ATTR(aligned(s))
69 # ifdef JEMALLOC_HAVE_ATTR_ALLOC_SIZE
70 # define JEMALLOC_ALLOC_SIZE(s) JEMALLOC_ATTR(alloc_size(s))
71 # define JEMALLOC_ALLOC_SIZE2(s1, s2) JEMALLOC_ATTR(alloc_size(s1, s2))
73 # define JEMALLOC_ALLOC_SIZE(s)
74 # define JEMALLOC_ALLOC_SIZE2(s1, s2)
76 # ifndef JEMALLOC_EXPORT
77 # define JEMALLOC_EXPORT JEMALLOC_ATTR(visibility("default"))
79 # ifdef JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF
80 # define JEMALLOC_FORMAT_PRINTF(s, i) JEMALLOC_ATTR(format(gnu_printf, s, i))
81 # elif defined(JEMALLOC_HAVE_ATTR_FORMAT_PRINTF)
82 # define JEMALLOC_FORMAT_PRINTF(s, i) JEMALLOC_ATTR(format(printf, s, i))
84 # define JEMALLOC_FORMAT_PRINTF(s, i)
86 # define JEMALLOC_NOINLINE JEMALLOC_ATTR(noinline)
87 # define JEMALLOC_NOTHROW JEMALLOC_ATTR(nothrow)
88 # define JEMALLOC_SECTION(s) JEMALLOC_ATTR(section(s))
89 # define JEMALLOC_RESTRICT_RETURN
90 # define JEMALLOC_ALLOCATOR
92 # define JEMALLOC_ATTR(s)
93 # define JEMALLOC_ALIGNED(s)
94 # define JEMALLOC_ALLOC_SIZE(s)
95 # define JEMALLOC_ALLOC_SIZE2(s1, s2)
96 # define JEMALLOC_EXPORT
97 # define JEMALLOC_FORMAT_PRINTF(s, i)
98 # define JEMALLOC_NOINLINE
99 # define JEMALLOC_NOTHROW
100 # define JEMALLOC_SECTION(s)
101 # define JEMALLOC_RESTRICT_RETURN
102 # define JEMALLOC_ALLOCATOR