Switch a local from long to size_t for MSVC
authorOrvid King <blah38621@gmail.com>
Tue, 8 Sep 2015 01:23:38 +0000 (18:23 -0700)
committerfacebook-github-bot-9 <folly-bot@fb.com>
Tue, 8 Sep 2015 02:20:21 +0000 (19:20 -0700)
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

index 23b42acf9aadc6d357c87c3a073f96b356b16b6f..0b3294bcd7590b644e33617ab2cdc11addb29380 100644 (file)
@@ -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);