HomeFreeBSD

rb_tree: optimize tree rotation

Description

rb_tree: optimize tree rotation

The RB_ROTATE macros begin with fetching a field via a pointer. In
most cases, that value is one that has already been pulled into a
register, and the compiler cannot infer that. So, to eliminate those
needless fetches, have the caller of the RB_ROTATE macros present the
data in the third macro parameter, rather than having the macro fetch
it.

Differential Revision: https://reviews.freebsd.org/D35520

(cherry picked from commit 61c74fb66f1bef776923cbd5b2a62fb06b003f0c)

Details

Provenance
dougmAuthored on Jun 25 2022, 7:40 AM
Differential Revision
D35520: rb_tree: optimize tree rotation
Parents
rG882c35e41275: rb_tree: silence coverity
Branches
Unknown
Tags
Unknown