Merge remote-tracking branch 'origin/master' into snmalloc2

This commit is contained in:
David Chisnall
2021-08-05 15:12:25 +01:00
12 changed files with 237 additions and 422 deletions

View File

@@ -48,6 +48,7 @@ namespace snmalloc
constexpr T one_at_bit(S shift)
{
static_assert(std::is_integral_v<T>, "Type must be integral");
SNMALLOC_ASSERT(sizeof(T) * 8 > static_cast<size_t>(shift));
return (static_cast<T>(1)) << shift;
}

View File

@@ -57,6 +57,14 @@
# endif
#endif
#ifdef __APPLE__
# define SNMALLOC_FORCE_BSS __attribute__((section("__DATA,__bss")))
#elif defined(__ELF__)
# define SNMALLOC_FORCE_BSS __attribute__((section(".bss")))
#else
# define SNMALLOC_FORCE_BSS
#endif
#ifndef __has_builtin
# define __has_builtin(x) 0
#endif