Skip to content

Commit daf66ec

Browse files
committed
erts: store AVL balance in low bits of ordered_set node left pointer
Encode the AVL balance factor in the two low bits of the TreeDbTerm left pointer instead of a separate field, reducing memory per node on 64-bit (one word saved per node). Requires 8-byte-aligned nodes (ERTS_ALLOC_ALIGN_BYTES >= 8). The linux kernel implements a similar trick for its Red-Black trees, storing the bits for the colour at the lowest bits of the pointer to the parent.
1 parent 6189ca0 commit daf66ec

5 files changed

Lines changed: 644 additions & 593 deletions

File tree

0 commit comments

Comments
 (0)