HomeFreeBSD

pctrie: correct iter node after node allocation

Description

pctrie: correct iter node after node allocation

Usually, a pctrie_iter operation leaves the iterator node pointing to
the last pctrie_node on the path to the found, or inserted, or removed
leaf. However, that is not the case when inserting a leaf causes the
allocation of a new pctrie node. In that case, the iterator node is
left pointing to the parent of the allocated node, and not to the
newly allocated node itself, the parent of the just-inserted
leaf. Correct this anomaly.

Reviewed by: markj, kib, alc
Differential Revision: https://reviews.freebsd.org/D51059

Details

Provenance
dougmAuthored on Jun 28 2025, 6:49 AM
Reviewer
markj
Differential Revision
D51059: pctrie: correct iter node after node allocation
Parents
rG0b46a53a2f50: Merge bmake-20250618
Branches
Unknown
Tags
Unknown