diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2023-02-10 18:54:08 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-14 18:05:25 +0000 |
commit | c419698b577f7924d2d6fc6bd3f7bd922f1d0dd7 (patch) | |
tree | 3e905dee10f0eec3fb40ac7550a4192520b58540 | |
parent | 5adf42d89dda28355ba5d60d755c0fbc89073208 (diff) | |
download | mongo-c419698b577f7924d2d6fc6bd3f7bd922f1d0dd7.tar.gz |
SERVER-71608 Add support to jscustomallocator.cpp for FreeBSD
-rw-r--r-- | src/mongo/scripting/mozjs/jscustomallocator.cpp | 4 |
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); |