Page MenuHomeFreeBSD

bitset: avoid pessimized code when bitset size is not constant
ClosedPublic

Authored by rlibby on Tue, Dec 3, 7:00 AM.

Details

Summary

We have a couple optimizations for when the bitset is known to be just
one word. But with dynamically sized bitsets, it was actually more work
to determine the size than just to do the necessary computation. Now,
only use the optimization when the size is known to be constant.

Test Plan

kyua test -k /usr/tests/sys/Kyuafile

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

rlibby created this revision.Tue, Dec 3, 7:00 AM
markj accepted this revision.Tue, Dec 3, 3:53 PM
markj added inline comments.
sys/sys/bitset.h
37 ↗(On Diff #65151)

I'd add a brief comment explaining why this is used.

This revision is now accepted and ready to land.Tue, Dec 3, 3:53 PM
rlibby updated this revision to Diff 65162.Tue, Dec 3, 4:36 PM

markj feedback: add a comment. Also, wrap a long line.

This revision now requires review to proceed.Tue, Dec 3, 4:36 PM
markj accepted this revision.Tue, Dec 3, 4:45 PM
This revision is now accepted and ready to land.Tue, Dec 3, 4:45 PM
This revision was automatically updated to reflect the committed changes.