Fix resplit | batch
[folly.git] / folly / Malloc.cpp
index fe8d8b6a421635193f13cad56a5d33bf6df13003..42a9d329ee305c869cb6d7c240f2089f12c86945 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2015 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
 
 #include <folly/Malloc.h>
 
+#include <cstdint>
+
 namespace folly {
 
 // How do we determine that we're using jemalloc?
@@ -25,15 +27,17 @@ namespace folly {
 // with --enable-stats.
 bool usingJEMallocSlow() {
   // Some platforms (*cough* OSX *cough*) require weak symbol checks to be
-  // in the form if (mallctl != NULL). Not if (mallctl) or if (!mallctl) (!!).
-  // http://goo.gl/xpmctm
-  if (allocm == nullptr || rallocm == nullptr || mallctl == nullptr) {
+  // in the form if (mallctl != nullptr). Not if (mallctl) or if (!mallctl)
+  // (!!). http://goo.gl/xpmctm
+  if (mallocx == nullptr || rallocx == nullptr || xallocx == nullptr
+      || sallocx == nullptr || dallocx == nullptr || nallocx == nullptr
+      || mallctl == nullptr) {
     return false;
   }
 
   // "volatile" because gcc optimizes out the reads from *counter, because
   // it "knows" malloc doesn't modify global state...
-  volatile uint64_t* counter;
+  /* nolint */ volatile uint64_t* counter;
   size_t counterLen = sizeof(uint64_t*);
 
   if (mallctl("thread.allocatedp", static_cast<void*>(&counter), &counterLen,
@@ -58,4 +62,3 @@ bool usingJEMallocSlow() {
 }
 
 }  // namespaces
-