Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
ray6080 committed Mar 12, 2023
1 parent a3c3c21 commit 5fad113
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class BufferRegion {
page_group_idx_t addNewPageGroup();

inline uint8_t* getFrame(common::page_idx_t pageIdx) {
return region + (pageIdx << pageSizeClass);
return region + ((std::uint64_t)pageIdx << pageSizeClass);
}

private:
Expand Down Expand Up @@ -120,7 +120,7 @@ class BufferManagedFileHandle : public FileHandle {
inline uint8_t* getFrame(common::page_idx_t localPageIdx) {
assert(localPageIdx < pageCapacity);
auto localPageGroupIdx = localPageIdx >> common::StorageConstants::PAGE_GROUP_SIZE_LOG2;
auto globalPageIdx =
common::page_idx_t globalPageIdx =
(pageGroupIdxes[localPageGroupIdx] << common::StorageConstants::PAGE_GROUP_SIZE_LOG2) +
localPageIdx - (localPageGroupIdx << common::StorageConstants::PAGE_GROUP_SIZE_LOG2);
return bufferRegion->getFrame(globalPageIdx);
Expand Down

0 comments on commit 5fad113

Please sign in to comment.