Merge "Use sysconf(_SC_PAGESIZE) instead of getpagesize()."

This commit is contained in:
Keisuke Kuroyanagi 2013-11-07 06:19:47 +00:00 committed by Android (Google) Code Review
commit fc1824ea55

View file

@ -35,7 +35,7 @@ namespace latinime {
AKLOGE("DICT: Can't open the source. path=%s errno=%d", path, errno);
return MmappedBufferPtr(0);
}
const int pagesize = getpagesize();
const int pagesize = sysconf(_SC_PAGESIZE);
const int offset = bufferOffset % pagesize;
int alignedOffset = bufferOffset - offset;
int alignedSize = bufferSize + offset;