Adopted SUPWIDE tag bit, parallel to the SUBWIDE (was WIDE) bit

Like SUBWIDE, SUPWIDE allows for "mask-like" operation during rbyd
commits, where you replace an entire subrange of tags with a single tag.

- SUBWIDE - Replace all subtypes of the given suptype - Useful for
  changing the subtype of an attr, for example replacing a BTREE with a
  BSHRUB.

- SUPWIDE - Replace all suptypes of the given rid - Useful for changing
  the suptype of an attr, for example replacing a REG file with an
  ORPHAN file.

These are effectively the same modifier, just with different ranges.

One benefit is this simplifies mid-level operations a bit, rename,
remove, etc, and decreases the stack cost of the related attr lists.
Though this isn't on the hot-path, so not measurable:

            code          stack
  before:  33956           2912
  after:   33928 (-0.1%)   2912 (+0.0%)

But the real motivation for this change is to remove cases where
lfsr_mdir_commit needs to operate on multiple mids. There may be an API
simplification here.
This commit is contained in:
Christopher Haster
2024-01-21 22:21:39 -06:00
parent e8b1be17fe
commit 5f25f32ff1
3 changed files with 522 additions and 97 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ code = '''
// name attributes, the name attribute holds the weight not
// the struct tag
return lfsr_btree_commit(lfs, btree, LFSR_ATTRS(
LFSR_ATTR(bid, WIDE(TAG(tag)), 0, DATA(data)),
LFSR_ATTR(bid, SUBWIDE(TAG(tag)), 0, DATA(data)),
LFSR_ATTR(bid, GROW, weight - weight_, NULL())));
}