Fix narenas size
authorDave Watson <davejwatson@fb.com>
Tue, 1 Mar 2016 17:52:58 +0000 (09:52 -0800)
committerFacebook Github Bot 1 <facebook-github-bot-1-bot@fb.com>
Tue, 1 Mar 2016 18:05:27 +0000 (10:05 -0800)
Summary:Changed from size_t to unsigned in a recent tp2 update
https://github.com/jemalloc/jemalloc/blame/3c07f803aa282598451eb0664cc94717b769a5e6/test/unit/mallctl.c

Reviewed By: jasone, mhlakhani

Differential Revision: D2991755

fb-gh-sync-id: 46f2be722a30706333eac6428f4183ca9cb85543
shipit-source-id: 46f2be722a30706333eac6428f4183ca9cb85543

folly/detail/MemoryIdler.cpp

index 95982df284eb51d86c252c8dc9ed0c2513d51c1f..1f17f8cc37d1aa76bdcf70142680018b1654e1c8 100644 (file)
@@ -74,11 +74,11 @@ void MemoryIdler::flushLocalMallocCaches() {
     // purging the arenas is counter-productive.  We use the heuristic
     // that if narenas <= 2 * num_cpus then we shouldn't do anything here,
     // which detects when the narenas has been reduced from the default
-    size_t narenas;
+    unsigned narenas;
     unsigned arenaForCurrent;
     size_t mib[3];
     size_t miblen = 3;
-    if (mallctlRead<size_t>("opt.narenas", &narenas) == 0 &&
+    if (mallctlRead<unsigned>("opt.narenas", &narenas) == 0 &&
         narenas > 2 * CacheLocality::system().numCpus &&
         mallctlRead<unsigned>("thread.arena", &arenaForCurrent) == 0 &&
         mallctlnametomib("arena.0.purge", mib, &miblen) == 0) {