boostorg / unordered

Boost.org unordered module
http://boost.org/libs/unordered
Boost Software License 1.0
63 stars 55 forks source link

Rehashing Conformity #144

Closed cmazakas closed 2 years ago

cmazakas commented 2 years ago

Update the rehash() and reserve() functions so that they behave similarly to libstdc++ and libc++, i.e. rehashing should grow and shrink the allocation accordingly while still respecting the max load factor

codecov[bot] commented 2 years ago

Codecov Report

Merging #144 (14a604b) into develop (dea6ce1) will decrease coverage by 0.04%. The diff coverage is 97.57%.

:exclamation: Current head 14a604b differs from pull request most recent head 9a9b8e0. Consider uploading reports for the commit 9a9b8e0 to get more accurate results

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/boostorg/unordered/pull/144/graphs/tree.svg?width=650&height=150&src=pr&token=ZqRPZlJZ5N&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg)](https://codecov.io/gh/boostorg/unordered/pull/144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg) ```diff @@ Coverage Diff @@ ## develop #144 +/- ## =========================================== - Coverage 97.45% 97.41% -0.05% =========================================== Files 75 75 Lines 10369 10509 +140 =========================================== + Hits 10105 10237 +132 - Misses 264 272 +8 ``` | [Impacted Files](https://codecov.io/gh/boostorg/unordered/pull/144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg) | Coverage Δ | | |---|---|---| | [test/unordered/noexcept\_tests.cpp](https://codecov.io/gh/boostorg/unordered/pull/144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg#diff-dGVzdC91bm9yZGVyZWQvbm9leGNlcHRfdGVzdHMuY3Bw) | `95.68% <81.48%> (-4.32%)` | :arrow_down: | | [include/boost/unordered/detail/fca.hpp](https://codecov.io/gh/boostorg/unordered/pull/144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg#diff-aW5jbHVkZS9ib29zdC91bm9yZGVyZWQvZGV0YWlsL2ZjYS5ocHA=) | `99.62% <100.00%> (+<0.01%)` | :arrow_up: | | [include/boost/unordered/detail/implementation.hpp](https://codecov.io/gh/boostorg/unordered/pull/144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg#diff-aW5jbHVkZS9ib29zdC91bm9yZGVyZWQvZGV0YWlsL2ltcGxlbWVudGF0aW9uLmhwcA==) | `98.92% <100.00%> (-0.25%)` | :arrow_down: | | [test/unordered/rehash\_tests.cpp](https://codecov.io/gh/boostorg/unordered/pull/144/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg#diff-dGVzdC91bm9yZGVyZWQvcmVoYXNoX3Rlc3RzLmNwcA==) | `100.00% <100.00%> (ø)` | | ------ [Continue to review full report at Codecov](https://codecov.io/gh/boostorg/unordered/pull/144?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/boostorg/unordered/pull/144?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg). Last update [2b61fbb...9a9b8e0](https://codecov.io/gh/boostorg/unordered/pull/144?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg).
joaquintides commented 2 years ago

Looks good to me. There's a lot of commented-out code in rehash_tests.cpp. After a private conversation with Chris, I understand that doc updates will arrive in a different PR --I'd rather have it all in one single PR, but this other approach works as well.

pdimov commented 2 years ago

The GHA and Appveyor failures are transient, but the Drone gcc 4.7 one looks legitimate.

joaquintides commented 2 years ago

Ouch, didn't see that one, thought they were all transient stuff.