From d2f85c1529fef8b9ada4d2547c62f772bd60ea39 Mon Sep 17 00:00:00 2001 From: Dave Watson Date: Tue, 1 Mar 2016 09:52:58 -0800 Subject: [PATCH] Fix narenas size 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/detail/MemoryIdler.cpp b/folly/detail/MemoryIdler.cpp index 95982df2..1f17f8cc 100644 --- a/folly/detail/MemoryIdler.cpp +++ b/folly/detail/MemoryIdler.cpp @@ -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("opt.narenas", &narenas) == 0 && + if (mallctlRead("opt.narenas", &narenas) == 0 && narenas > 2 * CacheLocality::system().numCpus && mallctlRead("thread.arena", &arenaForCurrent) == 0 && mallctlnametomib("arena.0.purge", mib, &miblen) == 0) { -- 2.34.1