Page MenuHomeFreeBSD

subr_rangeset: use pctrie_reclaim_callback in remove_all
ClosedPublic

Authored by dougm on Jun 13 2024, 4:57 PM.
Tags
None
Referenced Files
F97580403: D45584.id139814.diff
Mon, Sep 30, 4:34 AM
Unknown Object (File)
Tue, Sep 10, 7:14 PM
Unknown Object (File)
Aug 30 2024, 11:58 PM
Unknown Object (File)
Aug 29 2024, 8:18 PM
Unknown Object (File)
Aug 22 2024, 4:00 AM
Unknown Object (File)
Aug 17 2024, 7:15 PM
Unknown Object (File)
Aug 11 2024, 9:22 AM
Unknown Object (File)
Aug 8 2024, 9:18 AM
Subscribers

Details

Summary

Replace the lookup-and-remove loop in rangeset_remove_all with a call to RANGESET_PCTRIE_RECLAIM_CALLBACK, to avoid the repeated lookups.

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, 4:57 PM
dougm created this revision.

Logic looks good.

This does make me think, should we arrange to have name##_PCTRIE_RECLAIM_CALLBACK take a function pointer that is typed for the first argument? We would then need a cast to pctrie_cb_t for the calls to begin_cb/resume_cb, which I think both gcc and clang are okay with, but I am not actually sure what the standard says. That would help avoid mixing up the two void *s in the callback type and avoid the need for one of the casts in the callback.

This revision is now accepted and ready to land.Jun 13 2024, 5:39 PM

This does make me think, should we arrange to have name##_PCTRIE_RECLAIM_CALLBACK take a function pointer that is typed for the first argument? We would then need a cast to pctrie_cb_t for the calls to begin_cb/resume_cb, which I think both gcc and clang are okay with, but I am not actually sure what the standard says. That would help avoid mixing up the two void *s in the callback type and avoid the need for one of the casts in the callback.

I'm not opposed, though I'm also not sure about the standard. But I think I'll commit these bits first, and consider that next.