bustub icon indicating copy to clipboard operation
bustub copied to clipboard

replacer.h: Mistake in comment

Open MathieuBordere opened this issue 2 years ago • 1 comments

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.

MathieuBordere avatar Oct 30 '21 15:10 MathieuBordere

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;
    }

lfmunoz avatar Jan 31 '22 01:01 lfmunoz

This project is not maintained at least in this year.

skyzh avatar Sep 16 '22 04:09 skyzh