struct maple_big_node {
struct maple_pnode *parent;
- struct maple_enode *slot[MAPLE_BIG_NODE_SLOTS];
unsigned long pivot[MAPLE_BIG_NODE_SLOTS - 1];
- unsigned long gap[MAPLE_BIG_NODE_SLOTS];
+ union {
+ struct maple_enode *slot[MAPLE_BIG_NODE_SLOTS];
+ struct {
+ unsigned long padding[MAPLE_BIG_NODE_SLOTS/2 + 2];
+ unsigned long gap[MAPLE_BIG_NODE_SLOTS/2 + 2];
+ };
+ };
unsigned long min;
unsigned char b_end;
enum maple_type type;
memmove(b_node->pivot + shift, b_node->pivot, size);
memmove(b_node->slot + shift, b_node->slot, size);
- memmove(b_node->gap + shift, b_node->gap, size);
+ if (b_node->type == maple_arange_64)
+ memmove(b_node->gap + shift, b_node->gap, size);
}
/*
old_l = mast->orig_l->node;
if (mas_prev_sibling(mast->orig_l)) {
+ mast->bn->type = mte_node_type(mast->orig_l->node);
mast_rebalance_prev(mast, old_l);
return true;
}
{
bool cp = true;
struct maple_enode *old = mas->node;
- unsigned char split, zero;
+ unsigned char split;
+ memset(mast->bn->gap, 0, sizeof(unsigned long) * ARRAY_SIZE(mast->bn->gap));
+ memset(mast->bn->slot, 0, sizeof(unsigned long) * ARRAY_SIZE(mast->bn->slot));
+ memset(mast->bn->pivot, 0, sizeof(unsigned long) * ARRAY_SIZE(mast->bn->pivot));
mast->bn->b_end = 0;
+
if (mte_is_root(mas->node)) {
cp = false;
} else {
mast->bn->b_end--;
mast->bn->type = mte_node_type(mas->node);
-
- zero = MAPLE_BIG_NODE_SLOTS - mast->bn->b_end - 2;
- memset(mast->bn->gap + mast->bn->b_end + 1, 0,
- sizeof(unsigned long) * zero);
- memset(mast->bn->slot + mast->bn->b_end + 1, 0, sizeof(void*) * zero--);
- memset(mast->bn->pivot + mast->bn->b_end + 1, 0,
- sizeof(unsigned long) * zero);
}
/*