Added LFSR_BTREE/SHRUB_NULL, dropped lfsr_btree_alloc
Our B-trees lazily allocate their root blocks, so it makes more sense
for this to be a macro. Added/adopted a similar LFSR_SHRUB_NULL for
consistency.
Unfortunately this added a bit of code. I think because GCC struggles to
optimize compound literals, which both LFSR_BTREE_NULL and
LFSR_SHRUB_NULL expand into:
code stack
before: 33538 2624
after: 33550 (+0.0%) 2624 (+0.0%)
This commit is contained in:
@@ -42,8 +42,7 @@ code = '''
|
||||
lfs_alloc_ckpoint(&lfs);
|
||||
|
||||
// create a btree
|
||||
lfsr_btree_t btree;
|
||||
lfsr_btree_alloc(&lfs, &btree) => 0;
|
||||
lfsr_btree_t btree = LFSR_BTREE_NULL();
|
||||
|
||||
// set up a simulation to compare against
|
||||
char *sim = malloc(N);
|
||||
@@ -150,8 +149,7 @@ code = '''
|
||||
lfs_alloc_ckpoint(&lfs);
|
||||
|
||||
// create a btree
|
||||
lfsr_btree_t btree;
|
||||
lfsr_btree_alloc(&lfs, &btree) => 0;
|
||||
lfsr_btree_t btree = LFSR_BTREE_NULL();
|
||||
|
||||
// set up a simulation to compare against
|
||||
char *sim = malloc(N);
|
||||
@@ -254,8 +252,7 @@ code = '''
|
||||
lfs_alloc_ckpoint(&lfs);
|
||||
|
||||
// create a btree
|
||||
lfsr_btree_t btree;
|
||||
lfsr_btree_alloc(&lfs, &btree) => 0;
|
||||
lfsr_btree_t btree = LFSR_BTREE_NULL();
|
||||
|
||||
// set up a simulation to compare against
|
||||
char *sim = malloc(N);
|
||||
|
||||
Reference in New Issue
Block a user