Skip to content

Commit 8c0b3d8

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 8c0b3d8

5 files changed

Lines changed: 641 additions & 590 deletions

File tree

0 commit comments

Comments
 (0)