mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 23:39:31 +03:00
Add a missing #include
This change fixes the "implicit declaration of function 'getenv'" warning. Since stdlib.h is completely portable, as it is defined by the C standard, we can safely include it unconditionally.
This commit is contained in:
parent
03020fbf81
commit
566b2c51fc
1 changed files with 1 additions and 1 deletions
|
@ -27,6 +27,7 @@ terms of the MIT license. A copy of the license can be found in the file
|
||||||
#include <sys/mman.h> // mmap
|
#include <sys/mman.h> // mmap
|
||||||
#include <unistd.h> // sysconf
|
#include <unistd.h> // sysconf
|
||||||
#include <fcntl.h> // open, close, read, access
|
#include <fcntl.h> // open, close, read, access
|
||||||
|
#include <stdlib.h> // getenv, arc4random_buf
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
#include <features.h>
|
#include <features.h>
|
||||||
|
@ -773,7 +774,6 @@ bool _mi_prim_random_buf(void* buf, size_t buf_len) {
|
||||||
defined(__sun) || \
|
defined(__sun) || \
|
||||||
(defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7))
|
(defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7))
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
bool _mi_prim_random_buf(void* buf, size_t buf_len) {
|
bool _mi_prim_random_buf(void* buf, size_t buf_len) {
|
||||||
arc4random_buf(buf, buf_len);
|
arc4random_buf(buf, buf_len);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue