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 851
    • Issues 851
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 49
    • Merge requests 49
  • 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
  • !3212

Draft: GString: Support on-stack use

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Matthias Clasen requested to merge g-string-on-stack into main Jan 18, 2023
  • Overview 26
  • Commits 4
  • Pipelines 1
  • Changes 7

Move the preallocation into the GString struct, and add g_string_init and g_string_clear to enable on-stack use of GString.

Sadly, I had to fix some instances in glib where code was just assuming it can pull string->str out of a GString and use it like a malloced string. This may indicate that this is not a safe enough change to make. Opinions welcome

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: g-string-on-stack