Skip to content

Commit

Permalink
Switch a local from long to size_t for MSVC
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Orvid authored and facebook-github-bot-9 committed Sep 8, 2015
1 parent 29193ac commit 37cd970
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion folly/IndexedMemPool.h
Expand Up @@ -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);
Expand Down

0 comments on commit 37cd970

Please sign in to comment.