Skip to content

Commit

Permalink
Merge pull request #1232 from kuzudb/bm
Browse files Browse the repository at this point in the history
Fix bm mmap size
  • Loading branch information
ray6080 committed Feb 2, 2023
2 parents 253a992 + 85220bd commit 7804a70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/storage/buffer_manager/buffer_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ BufferPool::BufferPool(uint64_t pageSize, uint64_t maxSize)
: logger{LoggerUtils::getOrCreateLogger("buffer_manager")}, pageSize{pageSize}, clockHand{0},
numFrames((page_idx_t)(ceil((double)maxSize / (double)pageSize))) {
assert(pageSize == DEFAULT_PAGE_SIZE || pageSize == LARGE_PAGE_SIZE);
auto mmapRegion =
(u_int8_t*)mmap(NULL, maxSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
auto mmapRegion = (u_int8_t*)mmap(
NULL, (numFrames * pageSize), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
for (auto i = 0u; i < numFrames; ++i) {
auto buffer = mmapRegion + (i * pageSize);
bufferCache.emplace_back(make_unique<Frame>(pageSize, buffer));
Expand Down

0 comments on commit 7804a70

Please sign in to comment.