Hacker Newsnew | past | comments | ask | show | jobs | submit | janselman's commentslogin

Btw I'm not the author, author posted on reddit : https://www.reddit.com/r/C_Programming/comments/lh9irz/commo...

I don't know much about hashmaps but the disadvantage with tombstones is if you add/remove a lot, then you have to rehash your map at some point right?

I really like tiny libs anyway, yours looks good, very readable :)


I am not an expert either, but I would say that you have to rehash it either way if it grows (or shrinks). Tombstones as I understand it, are a way to "mark" deleted entries off of the hash table. Having these deleted entries marked ensures that your hash table doesn't break its "search chain". This is important so that you still can find entries that are put at another index when one index ("bucket") is already occupied.

However, I also don't shrink my table, once it grows. It stays grown. (Another drawback of my lib I suppose).

Thank you for the feedback, I really appreciate it! :)


Shrinking is not that necessary I believe. C++ and Java data structures do not shrink automatically either.


Great write up. It's common to add retry or reconnect mechanism to connections even there is no requirement. It's basically "restart your computer" to see if the issue disappears. So, it actually hides bugs for decades :)


https://github.com/uraimo/run-on-arch-action

It's on qemu, not that fast but it works.


Looks like easier than coordinates : https://www.bbc.com/news/uk-england-49319760


Because C++ has almost all the possible features of the programming languages, so you find a subset to like in it. A language shines when it picks the correct subset of the features, not all.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: