Skip to content

Commit a456235

Browse files
CactiFromDesertCactiFromDesert
authored andcommitted
fix: correct MAX_PAGE_NUM calculation
1 parent 9f856a5 commit a456235

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

src/observer/storage/buffer/disk_buffer_pool.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ struct BPFileHeader
7373
*/
7474
static const int MAX_PAGE_NUM =
7575
(BP_PAGE_DATA_SIZE - sizeof(buffer_pool_id) - sizeof(page_count) - sizeof(allocated_pages)) * 8;
76-
7776
string to_string() const;
7877
};
7978

@@ -352,5 +351,5 @@ class BufferPoolManager final
352351
common::Mutex lock_;
353352
unordered_map<string, DiskBufferPool *> buffer_pools_;
354353
unordered_map<int32_t, DiskBufferPool *> id_to_buffer_pools_;
355-
atomic<int32_t> next_buffer_pool_id_{1}; // 系统启动时,会打开所有的表,这样就可以知道当前系统最大的ID是多少了
354+
atomic<int32_t> next_buffer_pool_id_{1}; // 系统启动时,会打开所有的表,这样就可以知道当前系统最大的ID是多少了
356355
};

src/observer/storage/buffer/page.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ static constexpr PageNum BP_HEADER_PAGE = 0;
2525

2626
static constexpr const int BP_PAGE_SIZE = (1 << 13);
2727
static constexpr const int BP_PAGE_DATA_SIZE = (BP_PAGE_SIZE - sizeof(LSN) - sizeof(CheckSum));
28-
2928
/**
3029
* @brief 表示一个页面,可能放在内存或磁盘上
3130
* @ingroup BufferPool

0 commit comments

Comments
 (0)