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:
@@ -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())));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user