From: Christopher Dykes <cdykes@fb.com>
Date: Thu, 28 Apr 2016 17:17:19 +0000 (-0700)
Subject: Use the portability header for malloc_usable_size in small_vector.h
X-Git-Tag: 2016.07.26~309
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=22fa757160e1212dcece4e231dac02a218173837;p=folly.git

Use the portability header for malloc_usable_size in small_vector.h

Summary: `small_vector.h` had it's own thing being defined inline, and it was breaking the OSX build of HHVM, so have it use the portability header instead.

Reviewed By: yfeldblum

Differential Revision: D3232885

fb-gh-sync-id: 2078a54d1ec9700e81e0a9f4baed8e2d623fa5f3
fbshipit-source-id: 2078a54d1ec9700e81e0a9f4baed8e2d623fa5f3
---

diff --git a/folly/small_vector.h b/folly/small_vector.h
index b81d318a..f77efb30 100644
--- a/folly/small_vector.h
+++ b/folly/small_vector.h
@@ -47,6 +47,7 @@
 #include <folly/FormatTraits.h>
 #include <folly/Malloc.h>
 #include <folly/Portability.h>
+#include <folly/portability/Malloc.h>
 
 #if defined(__GNUC__) && (FOLLY_X64 || FOLLY_PPC64)
 # include <folly/SmallLocks.h>
@@ -59,16 +60,6 @@
 # define FB_PACK_POP
 #endif
 
-#if FOLLY_HAVE_MALLOC_SIZE
-  extern "C" std::size_t malloc_size(const void*);
-# if !FOLLY_HAVE_MALLOC_USABLE_SIZE
-#  define malloc_usable_size malloc_size
-# endif
-# ifndef malloc_usable_size
-#  define malloc_usable_size malloc_size
-# endif
-#endif
-
 // Ignore shadowing warnings within this file, so includers can use -Wshadow.
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wshadow"