Avoid collision with MacOS LIST_HEAD macro after #6384.

This commit is contained in:
antirez 2019-12-02 09:13:23 +01:00
parent e5b5f9a2f6
commit 4092a75d85
2 changed files with 8 additions and 1 deletions

View File

@ -388,6 +388,14 @@ int jemalloc_purge() {
#endif
#if defined(__APPLE__)
/* For proc_pidinfo() used later in zmalloc_get_smap_bytes_by_field().
* Note that this file cannot be included in zmalloc.h because it includes
* a Darwin queue.h file where there is a "LIST_HEAD" macro (!) defined
* conficting with Redis user code. */
#include <libproc.h>
#endif
/* Get the sum of the specified field (converted form kb to bytes) in
* /proc/self/smaps. The field must be specified with trailing ":" as it
* apperas in the smaps output.

View File

@ -57,7 +57,6 @@
#elif defined(__APPLE__)
#include <malloc/malloc.h>
#include <libproc.h>
#define HAVE_MALLOC_SIZE 1
#define zmalloc_size(p) malloc_size(p)
#endif