Simplified lfsr_mtree_t now that we don't need to represent msprouts

We had to be a bit clever with our lfsr_mtree_t representation to
support msprouts. Now that we don't support msprouts, we can simplify
this and drop the lfsr_mtree_t type completely! which is nice for both
code cost and readability.

Saves a bit more code:

           code          stack          ctx
  before: 38344           2624          640
  after:  38284 (-0.2%)   2624 (+0.0%)  640 (+0.0%)

Which increases the total savings of dropping msprouts:

                 code          stack          ctx
  yes msprouts: 38508           2624          640
  no msprouts:  38284 (-0.6%)   2624 (+0.0%)  640 (+0.0%)
This commit is contained in:
Christopher Haster
2025-01-30 03:35:07 -06:00
parent 3f4984d33f
commit 01f2d613bd
4 changed files with 133 additions and 191 deletions
+1 -14
View File
@@ -803,19 +803,6 @@ typedef struct lfsr_traversal {
// lfs_block_t pair[2];
//} lfs_gstate_t;
typedef struct lfsr_mtree {
union {
// the sign bit indicates if this is an inlined mdir/direct mdir
// pointer or a full mtree
lfsr_mid_t weight;
struct {
lfsr_mid_t weight;
lfs_block_t blocks[2];
} mptr;
lfsr_btree_t btree;
} u;
} lfsr_mtree_t;
// grm encoding:
// .---. mode: 1 leb128 1 byte
// |mod| mids: 2 leb128s <=2x5 bytes
@@ -855,7 +842,7 @@ typedef struct lfs {
lfsr_omdir_t *omdirs;
lfsr_mdir_t mroot;
lfsr_mtree_t mtree;
lfsr_btree_t mtree;
struct {
lfs_block_t block;