Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 860
    • Issues 860
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 39
    • Merge requests 39
  • 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
  • !2421

Add aligned memory allocators

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Emmanuele Bassi requested to merge ebassi/aligned-alloc into main Jan 06, 2022
  • Overview 26
  • Commits 3
  • Pipelines 8
  • Changes 6

When working with storage (especially GInputStream or GOutputStream) it is preferred to use page-aligned buffers so that the operating system can do page-mapping tricks as the operation passes through the kernel.

Another use case is allocating memory used for vectorised operations, which must be aligned to specific boundaries.

POSIX and Windows, as well as the C11 specification, provide this kind of allocator functions, and GLib already makes use of it inside GSlice. It would be convenient to have a public, portable wrapper that other projects can use.

Fixes: #2574 (closed)

Edited Feb 11, 2022 by Philip Withnall
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: ebassi/aligned-alloc