Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
G
GLib
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 924
    • Issues 924
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 56
    • Merge Requests 56
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • GLib
  • Issues
  • #1569

Closed
Open
Opened Oct 10, 2018 by Philip Withnall@pwithnallMaintainer

Add keyed hash functions (GHashMap)

From #1198 (comment 265420):

While I’m in favour of performance improvements to hashing which are applicable to a general set of use cases, I’m a bit hesitant about changing how GHashTable works at this point. The last time we changed the hashing algorithms (a number of years ago), there was a lot of fallout from applications and tests which had assumed a particular iteration order over a hash table. While that is definitely a bug in those applications, fixing it all was a massive pain. A change to Robin Hood hashing would necessarily change the iteration order again.

I wonder if, instead of changing GHashTable, we should introduce a new GHashMap (or similar) data type which implements Robin Hood hashing, but which also fixes bugs like #613, and uses keyed hash functions so we’re not vulnerable to attacks like this. (While we can tell people that GHashTable is not secure against that kind of attack, people are realistically going to continue using it in bits of code which are network accessible.)

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/glib#1569