c++20 (timid) introduction of constinit proposal.
This commit is contained in:
committed by
Matthew Parkinson
parent
e3a7eab789
commit
f3a9d3a682
@@ -20,6 +20,14 @@
|
||||
# define SNMALLOC_COLD __attribute__((cold))
|
||||
#endif
|
||||
|
||||
#if defined(__cpp_constinit) && __cpp_constinit >= 201907
|
||||
# define SNMALLOC_CONSTINIT_FN constinit
|
||||
# define SNMALLOC_CONSTINIT_STATIC constinit const
|
||||
#else
|
||||
# define SNMALLOC_CONSTINIT_FN constexpr
|
||||
# define SNMALLOC_CONSTINIT_STATIC constexpr
|
||||
#endif
|
||||
|
||||
#if !defined(__clang__) && defined(__GNUC__)
|
||||
# define GCC_NOT_CLANG
|
||||
#endif
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace snmalloc
|
||||
static constexpr uint64_t pal_features =
|
||||
AlignedAllocation | PALBSD<OS>::pal_features;
|
||||
|
||||
static constexpr size_t minimum_alloc_size = 4096;
|
||||
static SNMALLOC_CONSTINIT_STATIC size_t minimum_alloc_size = 4096;
|
||||
|
||||
/**
|
||||
* Reserve memory at a specific alignment.
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace snmalloc
|
||||
# endif
|
||||
;
|
||||
|
||||
static constexpr size_t minimum_alloc_size = 0x10000;
|
||||
static SNMALLOC_CONSTINIT_STATIC size_t minimum_alloc_size = 0x10000;
|
||||
|
||||
static constexpr size_t page_size = 0x1000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user