Skip to content

[RFC] Khash refactorings (pt. 2)#4417

Closed
pks-t wants to merge 20 commits into
libgit2:masterfrom
pks-t:pks/khash
Closed

[RFC] Khash refactorings (pt. 2)#4417
pks-t wants to merge 20 commits into
libgit2:masterfrom
pks-t:pks/khash

Conversation

@pks-t
Copy link
Copy Markdown
Member

@pks-t pks-t commented Nov 17, 2017

Another round of khash fixes. While my first round of fixes only touched our own abstractions (git_oidmap, git_strmap, git_idxmap and git_offmap), this PR revamps the complete khash implementation. I've been too fed up with digging into those awful macros, so I decided to take the bait and decided to refactor that part.

So what I did is to make the khash implementation itself non-generic. Instead of having a macro to create per-type map structs, we now have a single map which has a void pointer only. This relieves us of all those macro magic, but possibliy at the cost of performance. I haven't measured that yet, but will do so if desired.

So this is mostly cosmetic only. I plan to do further refactorings in the future, as I think our map interfaces simply suck right now. They are not intuitive and do not follow our coding guidelines. This here is a first step, but seeing that it may be controverse I wanted to put up a RFC first.

@pks-t
Copy link
Copy Markdown
Member Author

pks-t commented Feb 15, 2019

Closing in favor of #4901

@pks-t pks-t closed this Feb 15, 2019
@pks-t pks-t deleted the pks/khash branch February 15, 2019 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant