зеркало из https://github.com/microsoft/snmalloc.git
Fix still non getentropy platform builds
This commit is contained in:
Родитель
aefd149f0a
Коммит
9e88691ce6
|
@ -177,9 +177,7 @@ if(USE_POSIX_COMMIT_CHECKS)
|
|||
endif()
|
||||
|
||||
if(SNMALLOC_PLATFORM_HAS_GETENTROPY)
|
||||
target_compile_definitions(snmalloc_lib INTERFACE -DSNMALLOC_PLATFORM_HAS_GETENTROPY=Entropy)
|
||||
else()
|
||||
target_compile_definitions(snmalloc_lib INTERFACE -DSNMALLOC_PLATFORM_HAS_GETENTROPY=0)
|
||||
target_compile_definitions(snmalloc_lib INTERFACE -DSNMALLOC_PLATFORM_HAS_GETENTROPY)
|
||||
endif()
|
||||
|
||||
if(CONST_QUALIFIED_MALLOC_USABLE_SIZE)
|
||||
|
|
|
@ -19,12 +19,6 @@
|
|||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
// default value for builds not using CMake
|
||||
#ifndef SNMALLOC_PLATFORM_HAS_GETENTROPY
|
||||
# define SNMALLOC_PLATFORM_HAS_GETENTROPY 0
|
||||
# warning snmalloc not using entropy source. To silence this warning please define SNMALLOC_PLATFORM_HAS_GETENTROPY to 0, or to Entropy if your platform implements getentropy().
|
||||
#endif
|
||||
|
||||
extern "C" int puts(const char* str);
|
||||
|
||||
namespace snmalloc
|
||||
|
@ -126,8 +120,11 @@ namespace snmalloc
|
|||
* POSIX systems are assumed to support lazy commit. The build system checks
|
||||
* getentropy is available, only then this PAL supports Entropy.
|
||||
*/
|
||||
static constexpr uint64_t pal_features =
|
||||
LazyCommit | SNMALLOC_PLATFORM_HAS_GETENTROPY;
|
||||
static constexpr uint64_t pal_features = LazyCommit
|
||||
#if defined(SNMALLOC_PLATFORM_HAS_GETENTROPY)
|
||||
| Entropy
|
||||
#endif
|
||||
;
|
||||
|
||||
static constexpr size_t page_size = Aal::smallest_page_size;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче