bustub
bustub copied to clipboard
replacer.h: Mistake in comment
https://github.com/cmu-db/bustub/blob/4fd61c7cbcc51d16f30781c6c8f2ac2455403c42/src/include/buffer/replacer.h#L29
frame_id
is a pointer to a frame_id_t
which is an currently some integer type, it can't be set to a nullptr
by an implementation.
Yeah it can because it is a pointer of type frame_id_t. Setting the pointer to nullptr won't do anything once you exit the function though. You pass the address of the pointer to the function, the address it copied it should point to a variable from the calling function. If you overwrite the address to nullptr won't do anything because it was copied.
bool ClockReplacer::Victim(frame_id_t *frame_id) {
frame_id = nullptr;
return false;
}
This project is not maintained at least in this year.