From 37cd970a9dfd98d75baed229a922d138a2bf0b03 Mon Sep 17 00:00:00 2001 From: Orvid King Date: Mon, 7 Sep 2015 18:23:38 -0700 Subject: [PATCH] Switch a local from long to size_t for MSVC Summary: Because MSVC would try to calculate the mmapLength as a long value, which isn't correct, and MSVC issues multiple warnings if you try to do it. Closes #289 Reviewed By: @yfeldblum Differential Revision: D2419061 Pulled By: @JoelMarcey --- folly/IndexedMemPool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/IndexedMemPool.h b/folly/IndexedMemPool.h index 23b42acf9aa..0b3294bcd75 100644 --- a/folly/IndexedMemPool.h +++ b/folly/IndexedMemPool.h @@ -130,7 +130,7 @@ struct IndexedMemPool : boost::noncopyable { , globalHead_(TaggedPtr{}) { const size_t needed = sizeof(Slot) * (actualCapacity_ + 1); - long pagesize = sysconf(_SC_PAGESIZE); + size_t pagesize = sysconf(_SC_PAGESIZE); mmapLength_ = ((needed - 1) & ~(pagesize - 1)) + pagesize; assert(needed <= mmapLength_ && mmapLength_ < needed + pagesize); assert((mmapLength_ % pagesize) == 0);