summary refs log tree commit diff stats
path: root/lib/pure/collections/hashcommon.nim
Commit message (Collapse)AuthorAgeFilesLines
* Fix compile time errors when using tables on 8/16-bits systems. (#23450)Gianmarco2024-03-281-1/+4
| | | Refer to the discussion in #23439.
* Remove deprecated rightSize (#21011)Juan Carlos2022-12-081-10/+0
| | | | | * Remove deprecated rightSize nop * Remove deprecated rightSize nop
* out parameters: enforce that 'out' is only used as a parameter (#20510)Andreas Rumpf2022-10-071-1/+2
| | | | | | | * out parameters: enforce that 'out' is only used as a parameter * make tables.nim use 'out' parameters * better backwards compat
* move assertions out of system (#19599)flywind2022-03-231-0/+4
|
* [std/hashcommon]improve docs a bit (#18153)flywind2021-06-021-3/+3
| | | | * reduce duplicated deprecated messages
* Replace double backticks with single backticks - Part 3 out of ~7 (#17207)Danil Yarantsev2021-02-281-1/+1
|
* remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 ↵Timothee Cour2021-02-171-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#16918) * nimNoArrayToCstringConversion deadcode * nimbabel deadcode * nimHasalignOf deadcode * nimvarargstyped deadcode * nimhygiene deadcode * nimNewTypedesc deadcode * nimlocks deadcode * nimHasCppDefine deadcode * nimHasRunnableExamples deadcode * nimHasNilChecks deadcode * nimSymKind deadcode * minor macros refactoring * nimVmEqIdent deadcode * nimNoNil deadcode * nimNoZeroTerminator deadcode * nimHasSymOwnerInMacro deadcode * nimVmExportFixed deadcode * nimNewRuntime deadcode * nimAshr deadcode * nimUncheckedArrayTyp deadcode * nimHasTypeof deadcode * nimErrorProcCanHaveBody deadcode * nimHasHotCodeReloading deadcode * nimHasSignatureHashInMacro deadcode * nimHasDefault deadcode * nimMacrosSizealignof deadcode
* tables module uses runnableExamples (#16994)flywind2021-02-131-1/+1
| | | | | * tables module use runnableExamples * disable the tests
* remove a condition that table size must be passed as power of 2 (#14926)Miran2020-07-081-4/+10
| | | | | | | | | | | | | | | * 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-63/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#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.
* [backport] pseudorandom probing for hash collision (#13418)Timothee Cour2020-02-191-16/+71
|
* [other] prettify collections (#11695)Miran2019-07-091-4/+4
|
* Initialized collections (#11094)Miran2019-04-291-0/+68
* 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