Skip to content

Commit

Permalink
Refactor catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
lewiszlw committed Feb 27, 2024
1 parent 2d1c6bb commit 3fcb9da
Show file tree
Hide file tree
Showing 14 changed files with 364 additions and 137 deletions.
3 changes: 1 addition & 2 deletions bustubx/src/buffer/buffer_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ impl BufferPoolManager {
// 从磁盘分配一个页
let new_page_id = self.disk_manager.allocate_page().unwrap();
self.page_table.insert(new_page_id, frame_id);
let mut new_page = Page::new(new_page_id);
new_page.pin_count = 1;
let new_page = Page::new(new_page_id).with_pin_count(1u32);
self.pool[frame_id].write().unwrap().replace(new_page);

self.replacer.write().unwrap().record_access(frame_id)?;
Expand Down
Loading

0 comments on commit 3fcb9da

Please sign in to comment.