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

Use std::unique_ptr in pybind11_getbuffer #5435

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

QuLogic
Copy link
Contributor

@QuLogic QuLogic commented Nov 7, 2024

Description

Implements the suggestion from #5407 (comment)
Not sure if this is the best way.

@@ -605,7 +604,6 @@ extern "C" inline int pybind11_getbuffer(PyObject *obj, Py_buffer *view, int fla
// Fill in all the information, and then downgrade as requested by the caller, or raise an
// error if that's not possible.
view->obj = obj;
view->internal = info;
Copy link

Choose a reason for hiding this comment

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

This looks good, but feels a little inconsistent, why move setting view->internal to the end while setting view->buf here from the same info object? I would keep them both together, and it would be good to explain why it is moved to the end if that is preferred.

I think in the case of error info is deleted and also info->ptr.

@rwgk
Copy link
Collaborator

rwgk commented Nov 7, 2024

@cryos asked about the CI / 🐍 3 • Clang 11 • C++20 • x64 timeout offline:

That's a flake / infrastructure issue that popped up a couple days ago. I've been triggering reruns for several PRs, to make them go away. (I'll do that here in a minute.)

I hope the infrastructure issue will get fixed soon. It's not the first time that something like this happens here on GitHub.

Copy link

@cryos cryos left a comment

Choose a reason for hiding this comment

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

Thanks - looks good to me.

@cryos
Copy link

cryos commented Nov 8, 2024

@rwgk the failure appears to be a timeout if you could restart please.

@rwgk rwgk merged commit 037310e into pybind:master Nov 8, 2024
79 of 80 checks passed
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Nov 8, 2024
@rwgk
Copy link
Collaborator

rwgk commented Nov 8, 2024

Thanks @QuLogic and @cryos! I went ahead and merged this without rerunning the test that flaked. I'm sure it was a flake.

@rwgk rwgk removed the needs changelog Possibly needs a changelog entry label Nov 8, 2024
@QuLogic QuLogic deleted the getbuffer-unique_ptr branch November 8, 2024 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants