Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 857
    • Issues 857
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 56
    • Merge requests 56
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !3130

ghash: Add APIs to get (and steal) hash table keys and values as GPtrArray

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Marco Trevisan requested to merge 3v1n0/glib:ghash-keys+values-arrays into main Dec 14, 2022
  • Overview 13
  • Commits 10
  • Pipelines 5
  • Changes 11

GPtrArray's are faster than lists and provide more flexibility, so add APIs to get hash keys and values using these containers too.

Given that we know the size at array initialization we can optimize the allocation quite a bit, making it faster than the API using GList both at creation time and for consumers.

As per this is quite simple to implement stealing functions too, that allow to pass the ownership of the elements safely from a container to another.

And use these functions in few places around.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: ghash-keys+values-arrays