Rework free list so that 0 is the placeholder.

This is needed because in some configurations the constructor for the
global placeholder is not called before the first allocation (i.e. when
other globals call the allocator in their constructor) and so we ended
up following a null pointer.
This commit is contained in:
David Chisnall
2019-07-05 14:20:24 +01:00
parent 14b5c57b55
commit 2efcddfc3d
4 changed files with 13 additions and 11 deletions

View File

@@ -21,7 +21,7 @@
# include <emmintrin.h>
# define ALWAYSINLINE __attribute__((always_inline))
# define NOINLINE __attribute__((noinline))
# define SNMALLOC_SLOW_PATH NOINLINE
# define SNMALLOC_SLOW_PATH NOINLINE __attribute__((section(".text,slow")))
# define SNMALLOC_FAST_PATH inline ALWAYSINLINE
# define SNMALLOC_PURE __attribute__((const))
# ifdef __clang__