summary refs log tree commit diff stats
path: root/lib/pure/collections/setimpl.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes #22898; fix #22883 differently (#22900)ringabout2023-11-051-0/+2
| | | | | | fixes #22898 In these cases, the tables/sets are clears or elements are deleted from them. It's reasonable to suppress warnings because the value is not accessed anymore, which means it's safe to ignore the warnings.
* fixes #22883; replace `default(typeof(` with `reset`; suppress `Unsaf… ↵ringabout2023-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | (#22895) fixes #22883 …eDefault` warnings avoid issues mentioned by https://forum.nim-lang.org namely, it allocated unnecessary stack objects in the loop ```c while (1) { tyObject_N__8DSNqSGSHBKOhI8CqSgAow T5_; nimZeroMem((void *)(&T5_), sizeof(tyObject_N__8DSNqSGSHBKOhI8CqSgAow)); eqsink___test4954_u450((&(*t_p0).data.p->data[i].Field1), T5_); } ``` It might be more efficient in some cases follow up https://github.com/nim-lang/Nim/pull/21821
* use strictdefs for compiler (#22365)ringabout2023-08-061-0/+1
| | | | | | | | | | | | | | | * wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
* use single backtick (#17141)flywind2021-02-211-1/+1
|
* use typeof instead type (#16962)flywind2021-02-081-1/+1
|
* remove a condition that table size must be passed as power of 2 (#14926)Miran2020-07-081-2/+2
| | | | | | | | | | | | | | | * remove a condition that table size must be passed as power of 2 * remove power-of-2 condition from sets and sharedtables * remove power-of-2 condition from deques * use 'correctSize' for both branches * prettify changelog.md and fix typos * add a changelog entry * fix double-call of 'right-size' * fix the same thing in sets.nim * introduce a new internal proc `slotsNeeded` Deprecate the public proc `rightSize`, which is not needed anymore. Now it is an identity function, allowing the old code to work correctly and without extra allocations.
* Unwind just the "pseudorandom probing" part of recent sets,tables changes ↵c-blake2020-03-311-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#13816) * Unwind just the "pseudorandom probing" (whole hash-code-keyed variable stride double hashing) part of recent sets & tables changes (which has still been causing bugs over a month later (e.g., two days ago https://github.com/nim-lang/Nim/issues/13794) as well as still having several "figure this out" implementation question comments in them (see just diffs of this PR). This topic has been discussed in many places: https://github.com/nim-lang/Nim/issues/13393 https://github.com/nim-lang/Nim/pull/13418 https://github.com/nim-lang/Nim/pull/13440 https://github.com/nim-lang/Nim/issues/13794 Alternative/non-mandatory stronger integer hashes (or vice-versa opt-in identity hashes) are a better solution that is more general (no illusion of one hard-coded sequence solving all problems) while retaining the virtues of linear probing such as cache obliviousness and age-less tables under delete-heavy workloads (still untested after a month of this change). The only real solution for truly adversarial keys is a hash keyed off of data unobservable to attackers. That all fits better with a few families of user-pluggable/define-switchable hashes which can be provided in a separate PR more about `hashes.nim`. This PR carefully preserves the better (but still hard coded!) probing of the `intsets` and other recent fixes like `move` annotations, hash order invariant tests, `intsets.missingOrExcl` fixing, and the move of `rightSize` into `hashcommon.nim`. * Fix `data.len` -> `dataLen` problem.
* fix #13794 HashSet leak (#13800)Timothee Cour2020-03-291-1/+2
|
* tables/sharedtables/intsets/etc: fix #13496, #13504, #13505; add lots of ↵Timothee Cour2020-02-261-3/+3
| | | | | | | | | | | tests (#13498) [backport] * fix #13496 handle tombstones * add test * more tests * fix #13504; add SharedTable tests * fix #https://github.com/nim-lang/Nim/issues/13505 intsets.missingOrExcl silently gave wrong results sometimes * add test for tintsets
* [backport] pseudorandom probing for hash collision (#13418)Timothee Cour2020-02-191-18/+5
|
* use system.move instead of system.shallowCopy if the GC mode requires itAndreas Rumpf2019-10-041-1/+1
|
* [other] prettify collections (#11695)Miran2019-07-091-10/+10
|
* Initialized collections (#11094)Miran2019-04-291-0/+153
* tables: initialized by default * sets: initialized by default * DRY: extract shared functionality * add a changelog entry * fix errors * don't test include files * make it work for sharedtables * fix discovered bugs * add exhaustive tests