summaryrefslogtreecommitdiff
path: root/src/mongo/scripting/mozjs/jscustomallocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/scripting/mozjs/jscustomallocator.cpp')
-rw-r--r--src/mongo/scripting/mozjs/jscustomallocator.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/scripting/mozjs/jscustomallocator.cpp b/src/mongo/scripting/mozjs/jscustomallocator.cpp
index f8031f54ad2..28afb60fa88 100644
--- a/src/mongo/scripting/mozjs/jscustomallocator.cpp
+++ b/src/mongo/scripting/mozjs/jscustomallocator.cpp
@@ -43,6 +43,8 @@
#include <malloc/malloc.h>
#elif defined(_WIN32)
#include <malloc.h>
+#elif defined(__FreeBSD__)
+#include <malloc_np.h>
#else
#define MONGO_NO_MALLOC_USABLE_SIZE
#endif
@@ -183,7 +185,7 @@ size_t get_current(void* ptr) {
return 0;
return *reinterpret_cast<size_t*>(static_cast<char*>(ptr) - kMaxAlign);
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__FreeBSD__)
return malloc_usable_size(ptr);
#elif defined(__APPLE__)
return malloc_size(ptr);