Closed SaintNerevar closed 2 years ago
releaseBlock()
Class BlockBuffer
, Class RecBuffer
, Class IndInternal
, Class IndLeaf
, the new function loadBlockAndGetBufferPtr
method is being called which will be checking the validity of block inside it and hence, none of other methods will work properly once releaseBlock
is done (Expected behaviour)
Most methods in BlockBuffer don't handle the case of being called after the block has been released. Some methods do return E_OUTOFBOUND in that case but the calling methods do no handle this return value. One solution would be to have getBufferPtr() immediately raise an exception when it's called in an object with invalid blockNum. releaseBlock() itself would also have to throw an exception if the same block is sttempted to be released more than once.