Implement generalized btree push, note the boundary conditions when id=weight
This really just required care around calculating the expected B-tree id and rbyd id (which are different!). B-tree append, aka B-tree push with id=weight, is actually the outlier. We need a B-tree id that can identify the rbyd we're appending to, but this id itself doesn't exist in the tree yet, which can be a bit tricky.
This commit is contained in:
@@ -367,12 +367,12 @@ typedef struct lfsr_branch {
|
||||
} lfsr_branch_t;
|
||||
|
||||
typedef struct lfsr_btree {
|
||||
lfs_size_t weight;
|
||||
// TODO do we need full tag actually? this fits in a byte?
|
||||
lfsr_tag_t tag;
|
||||
// how can we take advantage of byte packing with union alignment?
|
||||
union {
|
||||
struct {
|
||||
lfs_size_t weight;
|
||||
uint8_t size;
|
||||
uint8_t buf[LFSR_BTREE_INLINE_SIZE];
|
||||
} inlined;
|
||||
|
||||
Reference in New Issue
Block a user