From: Orvid King Date: Tue, 8 Sep 2015 01:23:38 +0000 (-0700) Subject: Switch a local from long to size_t for MSVC X-Git-Tag: deprecate-dynamic-initializer~435 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=37cd970a9dfd98d75baed229a922d138a2bf0b03;p=folly.git 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 --- diff --git a/folly/IndexedMemPool.h b/folly/IndexedMemPool.h index 23b42acf..0b3294bc 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);