/* Skip possible duplicate entry that contains a NULL */
if (!append) {
- if (ma_get_pivot(prev_enode, old_end) <= mas->last)
+ if (mas->last >= last_piv)
+ goto complete;
+
+ while (ma_get_pivot(prev_enode, old_end) <= mas->last &&
+ old_end < slot_cnt)
old_end++;
/* Copy remainder of node if this isn't an append */
if (ret)
return ret;
-retry:
leaf = _mas_walk(mas);
slot = ma_get_slot(mas);
- // Clean this node
- if (mas_coalesce(mas)) {
- if (mas_is_err(mas))
- return 0;
- goto retry;
- }
-
if (leaf == true && slot != MAPLE_NODE_SLOTS) {
if (!overwrite) {
void *entry = ma_get_rcu_slot(mas->node, slot);
// At this point, mas->node points to the right node and we have a
// slot that has a sufficient gap.
-#if 0
- //FIXME: coalesce is an odd beast
- mas_coalesce(mas);
- if (mas_is_err(mas))
- return xa_err(mas->node);
-#endif
-
min = mas->min;
if (slot)
min = ma_get_pivot(mas->node, slot - 1) + 1;
// At this point, mas->node points to the right node and we have a
// slot that has a sufficient gap.
-#if 0
- //FIXME: coalesce is an odd beast
- mas_coalesce(mas);
- if (mas_is_err(mas))
- return xa_err(mas->node);
-#endif
// If the maximum is outside the window we are searching, then use the
// last location in the search.
if (mas->max > mas->last)
check_insert(mt, set[1], mt);
// Check erase and load without an allocation.
+
check_erase(mt, set[1]);
check_load(mt, set[0], ptr);
check_load(mt, set[1], NULL);
check_erase(mt, set[2]); // erase 5017 to check append
check_erase(mt, set[0]); // erase 5015 to check append
check_insert(mt, set[4], ptr); // 1000 < Should NOT split
-
check_load(mt, set[0], NULL);
check_load(mt, 5016, NULL);
check_load(mt, set[1], mt);