Page MenuHomeFreeBSD

pctrie: avoid typecast
ClosedPublic

Authored by dougm on Jun 13 2024, 7:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 4:43 AM
Unknown Object (File)
Sat, Nov 9, 8:46 PM
Unknown Object (File)
Sun, Nov 3, 1:24 AM
Unknown Object (File)
Sun, Nov 3, 1:24 AM
Unknown Object (File)
Sun, Nov 3, 1:24 AM
Unknown Object (File)
Sun, Nov 3, 1:21 AM
Unknown Object (File)
Sun, Nov 3, 1:08 AM
Unknown Object (File)
Mon, Oct 21, 11:54 AM
Subscribers

Details

Summary

Have PCTRIE_RECLAIM_CALLBACK typecast one function pointer type to another, to relieve the writer of the call back function from having to cast its first argument from void* to member type.

Diff Detail

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

Event Timeline

dougm requested review of this revision.Jun 13 2024, 7:22 PM
dougm created this revision.

Get rid of a callback function pointer type that would only create a namespace collision someday when somebody used two pctries in the same compilation unit.

LGTM. Did you check that clang and gcc don't produce warnings? I don't think they should. I can try applying and checking this evening if you haven't already.

This revision is now accepted and ready to land.Jun 14 2024, 1:41 AM

LGTM. Did you check that clang and gcc don't produce warnings? I don't think they should. I can try applying and checking this evening if you haven't already.

I did not. Please check it out.

I checked for warnings, nothing new in subr_pctrie.c, subr_rangeset.c, or swap_pager.c. Good to go.

gcc13 is producing a few warnings for subr_pctrie.c, but I don't think any are actual problems. meta file here:
https://people.freebsd.org/~rlibby/gcc13-subr_pctrie.o.meta

  • The -Wcast-qual stuff is due to atomic_load_ptr, nothing to be done about that here for pctrie.
  • The -Wmaybe-uninitialized I'm pretty sure is a false positive. It could be silenced with a NULL initialization though.
  • The -Wattributes I think are harmless... Not sure if there's a nice way to silence those.
This revision was automatically updated to reflect the committed changes.