mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
65f83d01a3
|
@ -31,7 +31,13 @@
|
||||||
|
|
||||||
#include "Basics/locks.h"
|
#include "Basics/locks.h"
|
||||||
|
|
||||||
#ifdef TRI_HAVE_MACOS_MEM_STATS
|
#ifndef BSD
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#define BSD
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (defined(BSD) || defined(TRI_HAVE_MACOS_MEM_STATS))
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -342,7 +348,7 @@ static void DestroyStatisticsList (TRI_statistics_list_t* list) {
|
||||||
/// @brief gets the physical memory
|
/// @brief gets the physical memory
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef TRI_HAVE_MACOS_MEM_STATS
|
#if (defined(BSD) || defined(TRI_HAVE_MACOS_MEM_STATS))
|
||||||
|
|
||||||
static uint64_t GetPhysicalMemory () {
|
static uint64_t GetPhysicalMemory () {
|
||||||
int mib[2];
|
int mib[2];
|
||||||
|
@ -351,7 +357,11 @@ static uint64_t GetPhysicalMemory () {
|
||||||
|
|
||||||
// Get the Physical memory size
|
// Get the Physical memory size
|
||||||
mib[0] = CTL_HW;
|
mib[0] = CTL_HW;
|
||||||
|
#ifdef TRI_HAVE_MACOS_MEM_STATS
|
||||||
mib[1] = HW_MEMSIZE;
|
mib[1] = HW_MEMSIZE;
|
||||||
|
#else
|
||||||
|
mib[1] = HW_PHYSMEM; // The bytes of physical memory. (kenel + user space)
|
||||||
|
#endif
|
||||||
length = sizeof(int64_t);
|
length = sizeof(int64_t);
|
||||||
sysctl(mib, 2, &physicalMemory, &length, nullptr, 0);
|
sysctl(mib, 2, &physicalMemory, &length, nullptr, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue