Page MenuHomeFreeBSD

pctrie: drop meaningless neighbor check
ClosedPublic

Authored by dougm on Oct 24 2024, 9:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 13, 5:56 AM
Unknown Object (File)
Sun, Apr 12, 10:46 PM
Unknown Object (File)
Sat, Apr 11, 11:12 PM
Unknown Object (File)
Sun, Apr 5, 8:46 AM
Unknown Object (File)
Sun, Mar 29, 12:57 PM
Unknown Object (File)
Sat, Mar 28, 9:26 PM
Unknown Object (File)
Fri, Mar 20, 7:59 PM
Unknown Object (File)
Jan 28 2026, 2:23 AM
Subscribers

Details

Summary

In PCTRIE_INSERT_LOOKUP_{G,L}E, there is a test - if two pointers are equal, replace one with a new value. The pointers can never be equal; one points to a struct pctrie_node and the other is the (void*) cast of a pointer to a field within a struct pctrie_node. So the tests and assignments can be removed with no effect.

If the assignments were made under some other conditions, they would only move the neighbor pointer one level up the tree, undoing the benefits of a neighbor update near the end of pctrie_insert_lookup_compount.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable