NITCbase / nitcbase.github.io

The entire documentation on implementing the NITCbase project.
https://nitcbase.github.io/
MIT License
10 stars 6 forks source link

Calling getBlock in BlockBuffer constructor 2 is unnecessary #23

Closed SaintNerevar closed 2 years ago

SaintNerevar commented 2 years ago

The design stipulates that any get/set methods accessing disk blocks must call BlockBuffer::getBufferPtr() which calls getBlock(). So, not calling getBlock() in the constructor simply delays copying the block into the buffer until it is actually needed i.e to access the blocks data.

gokulsreekumar commented 2 years ago