Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pypy
pypy
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 594
    • Issues 594
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 10
    • Merge Requests 10
  • 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
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

This instance will be upgraded to the latest Heptapod 0.20rc on 2021-02-26 at 11:00 UTC+1

  • PyPy
  • pypypypy
  • Issues
  • #3130

Closed
Open
Opened Dec 18, 2019 by Bitbucket Importer@bitbucket_importerMaintainer

[cpyext] internal field of buffer struct lost or ignored

Created originally on Bitbucket by nlgranger

When creating an object exposing the buffer protocol, the python specification offers an internal field in the buffer struct to store custom values. This field is incorrectly set to NULL when releasebuffer is called instead of keeping the value it was initially assigned. Presumable, PyPy didn’t even read that value.

In the attached example, the internal field is read back by RefCountedBuffer_releasebuffer when a buffer gets released in mymodule.c l118. The example is a wrapper around objects already exposing the buffer API, it adds a refcount to track how many views of the buffer exist and triggers a callback when that count reaches 0.

Attachments: cpyext_with_buffer.zip

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: pypy/pypy#3130