Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • cffi cffi
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 74
    • Issues 74
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & 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
  • PyPy
  • cfficffi
  • Issues
  • #115

Closed
Open
Created Nov 01, 2013 by Bitbucket Importer@bitbucket_importerMaintainer

A way to allocate and initialize unmanaged memory with ffi.new-like syntax

Created originally on Bitbucket by waedt (Tyler Wade)

I would like to see cffi provide a way to allocate/initialize memory in a way similar to ffi.new, but without the memory being freed automatically by cffi. My use case is returning a string from a callback. Using ffi.new won't work because cffi will free the string automatically and while I can use malloc and copy the string manually, being able to simply write return ffi.unmanaged_new('char*', some_str) would be much easier and more readable. (I'm not suggesting the name unmanaged_new.)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking