Commit 37cd970a authored by Orvid King's avatar Orvid King Committed by facebook-github-bot-9

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
parent 29193aca
...@@ -130,7 +130,7 @@ struct IndexedMemPool : boost::noncopyable { ...@@ -130,7 +130,7 @@ struct IndexedMemPool : boost::noncopyable {
, globalHead_(TaggedPtr{}) , globalHead_(TaggedPtr{})
{ {
const size_t needed = sizeof(Slot) * (actualCapacity_ + 1); 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; mmapLength_ = ((needed - 1) & ~(pagesize - 1)) + pagesize;
assert(needed <= mmapLength_ && mmapLength_ < needed + pagesize); assert(needed <= mmapLength_ && mmapLength_ < needed + pagesize);
assert((mmapLength_ % pagesize) == 0); assert((mmapLength_ % pagesize) == 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment