Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HtSP, HtSS, HtSU, SetS #4415

Merged
merged 16 commits into from
Apr 16, 2024
Merged

Add HtSP, HtSS, HtSU, SetS #4415

merged 16 commits into from
Apr 16, 2024

Conversation

pelijah
Copy link
Contributor

@pelijah pelijah commented Apr 4, 2024

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

  • All ht_*_new0() are removed
  • freefn field of HT options was renamed to finiKV
  • finiKV_user fields was added to HT options
  • Added ht_*_new_opt_size API
  • HtSP and HtUP are created with ValueFree callback that allows to reduce extra LOC and prevent bugs
  • SetP replaced with SetS (based on HtSP)
  • rz_th_ht_*_new0() and rz_th_ht_*_new_opt() are replaced with rz_th_ht_*_new(HtXX *)

Copy link
Member

@XVilka XVilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it is to address #4261 ?

Overall I agree with the change but not sure if names of new functions are good ones. It's not clear what they are supposed to do just from the name, IMHO.

Also, since many of the calls use default arguments, what about creating a wrapper called something like ht_..._new_default_opts()?

@ret2libc please take a look at this PR.

librz/util/ht/ht_inc.c Outdated Show resolved Hide resolved
librz/util/ht/ht_pp.c Outdated Show resolved Hide resolved
librz/diff/diff.c Show resolved Hide resolved
@XVilka XVilka requested a review from Rot127 April 5, 2024 00:39
@ret2libc
Copy link
Member

ret2libc commented Apr 5, 2024

The PR looks good overall, I'll do a full review once it's ready for review. I agree however the names might not be ideal... 1) i think we should add some explanation for all existing ht (or at least this new ones) 2) instead of s2p/s2s we should use sp, ss because the others are called uu, pp, etc.

librz/util/ht/ht_pp.c Outdated Show resolved Hide resolved
Copy link
Member

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would do a full review when it is ready as well. Also agree with ret2libc and xvilka when it comes to the naming.

@pelijah
Copy link
Contributor Author

pelijah commented Apr 5, 2024

instead of s2p/s2s we should use sp, ss because the others are called uu, pp, etc.

@ret2libc Do you mean to replace 'HtPP * ht_pp_new_s2p()' with 'HtPP * ht_sp_new()' or to add a whole bunch of HtSP API? The second one seems not less confusing because HtSP still be HtPP. Not to mention HtSS.

@XVilka

This comment has been minimized.

@pelijah pelijah requested review from XVilka, wargio, Rot127 and ret2libc and removed request for thestr4ng3r, yossizap and kazarmy April 16, 2024 09:33
@XVilka XVilka merged commit f2d8e0d into rizinorg:dev Apr 16, 2024
43 of 44 checks passed
@pelijah pelijah deleted the ht_pp_s2p branch April 28, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants