Commit 66a07640 authored by Sara Golemon's avatar Sara Golemon Committed by Alecs King

MacOS doesn't have malloc_usable_size()

Summary:
Use malloc_size() instead

Test Plan: HHVM build on MacOS

Reviewed By: joelm@fb.com

Subscribers: trunkagent, folly-diffs@, yfeldblum

FB internal diff: D1875364

Signature: t1:1875364:1425061479:7d8cec757c186fa8c30b6500fca6b2fe4c1ed137
parent 1f6e3142
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
#include <folly/CPortability.h> #include <folly/CPortability.h>
#ifdef __APPLE__
# include <malloc/malloc.h>
#endif
#if FOLLY_HAVE_SCHED_H #if FOLLY_HAVE_SCHED_H
#include <sched.h> #include <sched.h>
#ifndef FOLLY_HAVE_PTHREAD_YIELD #ifndef FOLLY_HAVE_PTHREAD_YIELD
...@@ -255,4 +259,11 @@ using namespace FOLLY_GFLAGS_NAMESPACE; ...@@ -255,4 +259,11 @@ using namespace FOLLY_GFLAGS_NAMESPACE;
#include <TargetConditionals.h> #include <TargetConditionals.h>
#endif #endif
// MacOS doesn't have malloc_usable_size()
#if defined(__APPLE__) && !defined(FOLLY_HAVE_MALLOC_USABLE_SIZE)
inline size_t malloc_usable_size(void* ptr) {
return malloc_size(ptr);
}
#endif
#endif // FOLLY_PORTABILITY_H_ #endif // FOLLY_PORTABILITY_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment