NITCbase / nitcbase.github.io

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

BlockBuffer::setHeader must set the Block Type in the Block Allocation Map #22

Closed SaintNerevar closed 1 year ago

SaintNerevar commented 2 years ago

Since setHeader actually modifies the block type of the block being set, it's also its responsibility to set the correct block type in the Block Allocation Map.

jessiyajoy commented 2 years ago

According to the existing design,

This should be changed such that whenever block type needs to be updated, it should be updated in both block header and Block Allocation Map. setHeader and setBlockType needs to be changed accordingly.

gokulsreekumar commented 2 years ago

Solutions possible:

  1. setBlockType() should update Block Allocation Map AND Block Header field. setHeader() can call setBlockType() to set type. For other header fields it can do the update itself.
  2. setHeader() does current setHeader function, in addition to which it calls setBlockType
clifordjoshy commented 1 year ago

A block once allocated should not be allowed to change it's type. It should be freed and reallocated. I'll mention in the caution section for the function that the block type is not expected to be changed at runtime

clifordjoshy commented 1 year ago

Additionally, the getBlockType() is never used. Removing it from the spec

clifordjoshy commented 1 year ago

setBlockType() does not need to be exposed outside the Buffer Layer. Making it protected