Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-45459: Add Py_buffer to limited API #29991

Merged
merged 12 commits into from
Feb 2, 2022

Conversation

tiran
Copy link
Member

@tiran tiran commented Dec 8, 2021

  • Py_buffer struct
  • PyBuffer_*() API functions
  • PyBUF_* constants
  • Py_bf_getbuffer and Py_bf_releasebuffer type slots
  • PyMemoryView_FromBuffer() API
  • tests for limited API
  • make regen-limited-abi
  • documentation update
  • export PyPickleBuffer*() API ???

https://bugs.python.org/issue45459

Automerge-Triggered-By: GH:encukou

@tiran tiran requested a review from encukou December 8, 2021 14:12
@tiran tiran marked this pull request as ready for review December 8, 2021 18:15
@tiran tiran requested a review from a team as a code owner December 8, 2021 18:15
@github-actions
Copy link

github-actions bot commented Jan 8, 2022

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jan 8, 2022
@tiran tiran force-pushed the bpo-45459-bufapi-struct branch 2 times, most recently from a990f73 to 200d441 Compare January 13, 2022 10:40
@tiran tiran removed the stale Stale PR or inactive for long period of time. label Jan 21, 2022
@tiran tiran force-pushed the bpo-45459-bufapi-struct branch 2 times, most recently from 1c41c9d to ef19458 Compare January 24, 2022 08:00
@tiran
Copy link
Member Author

tiran commented Jan 28, 2022

@encukou could you take a look, please?

@encukou
Copy link
Member

encukou commented Jan 31, 2022

I'll get to it this week.

Doc/data/stable_abi.dat Show resolved Hide resolved
Include/buffer.h Outdated
*
*/

typedef struct bufferinfo {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we leave out the bufferinfo tag? Anonymous structs are well-supported nowadays, and only Py_buffer should be public.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

Include/cpython/object.h Outdated Show resolved Hide resolved
Modules/xxlimited.c Outdated Show resolved Hide resolved
Modules/xxlimited.c Outdated Show resolved Hide resolved
Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's get it in! Thanks!

@rdb
Copy link

rdb commented Feb 7, 2022

This change broke our project build because when cpython/object.h is including buffer.h it is forcing it to resolve along the search path, and the compiler is hitting the buffer.h in our project rather than the one in the Python include directory.

Should it not be using a relative include, ie. #include "../buffer.h" ? I think otherwise this change will cause breakage for many projects given how common the header name "buffer.h" may be.

@tiran
Copy link
Member Author

tiran commented Feb 7, 2022

This PR is merged and closed. Please discuss this issue on the Python bug tracker.

@python python locked as resolved and limited conversation to collaborators Feb 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants