Skip to content

Commit b6cc751

Browse files
authored
fix(p1): fix file header and comments (#694)
* fix header and misleading comments * update comments
1 parent 1b40559 commit b6cc751

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/include/storage/disk/write_back_cache.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
//
33
// BusTub
44
//
5-
// cow_buffer.h
5+
// write_back_cache.h
66
//
7-
// Identification: src/include/storage/disk/cow_buffer.h
7+
// Identification: src/include/storage/disk/write_back_cache.h
88
//
9-
// Copyright (c) 2015-2023, Carnegie Mellon University Database Group
9+
// Copyright (c) 2015-2024, Carnegie Mellon University Database Group
1010
//
1111
//===----------------------------------------------------------------------===//
1212

@@ -21,10 +21,10 @@
2121
namespace bustub {
2222

2323
/**
24-
* WriteBackCache provides extra memory space other than the buffer pool to store the copy-on-write pages.
25-
* It's purpose is to gather the copy of pages that are about to be written back to disk, so that the bpm
26-
* doesn't have to incur IO penality and wait for the write to be completed when evicting.
27-
* Spring 24: The buffer is limited to store a constant number of pages in total (8).
24+
* WriteBackCache provides extra memory space other than the buffer pool to store the pages. It's purpose
25+
* is to gather the copy of pages that are about to be written back to disk, so that the bpm doesn't have
26+
* to incur IO penality and wait for the write to be completed when evicting.
27+
* Spring 24: The cache is limited to store a constant number of pages in total (8).
2828
* !! ANY ATTEMPTS TO ADD ANOTHER IN-MEMORY CACHE WILL BE REVIEWED MANUALLY AS PER LEADERBOARD POLICY !!
2929
*/
3030
class WriteBackCache {
@@ -36,7 +36,7 @@ class WriteBackCache {
3636
/**
3737
* @brief Adds a new page to the write back cache.
3838
* @param page the page pointer from the bpm that is about to be evicted.
39-
* @return pointer to the copied page in the buffer, or nullptr if the buffer is full.
39+
* @return pointer to the copied page in the cache, or nullptr if the cache is full.
4040
*/
4141
auto Add(Page *page) -> Page * {
4242
if ((page == nullptr) || IsFull()) {
@@ -61,10 +61,10 @@ class WriteBackCache {
6161
}
6262

6363
private:
64-
/** @brief Whether the buffer is full. */
64+
/** @brief Whether the cache is full. */
6565
auto IsFull() -> bool { return free_slot_bitmap_ == 0xFFU; }
6666

67-
/** @brief Finds a free slot in the buffer, if not full. */
67+
/** @brief Finds a free slot in the cache, if not full. */
6868
auto FindFreeSlot() -> uint32_t {
6969
BUSTUB_ASSERT(!IsFull(), "no free slot in write back cache");
7070
uint32_t i = 0;

test/storage/write_back_cache_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
//
33
// BusTub
44
//
5-
// page_guard_test.cpp
5+
// write_back_cache_test.cpp
66
//
7-
// Identification: test/storage/page_guard_test.cpp
7+
// Identification: test/storage/write_back_cache_test.cpp
88
//
9-
// Copyright (c) 2015-2023, Carnegie Mellon University Database Group
9+
// Copyright (c) 2015-2024, Carnegie Mellon University Database Group
1010
//
1111
//===----------------------------------------------------------------------===//
1212

0 commit comments

Comments
 (0)