Content-Length: 331164 | pFad | http://github.com/python/cpython/pull/110246/commits/5c5662dd9f2dd78ad80cd760c33406d98bd168d7

61 gh-76785: Add SendChannel.send_buffer() by ericsnowcurrently · Pull Request #110246 · python/cpython · GitHub
Skip to content

gh-76785: Add SendChannel.send_buffer() #110246

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

Merged
merged 20 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add PyUnstable_Buffer_ReleaseInInterpreter() and PyUnstable_Buffer_Re…
…leaseInInterpreterAndRawFree().
  • Loading branch information
ericsnowcurrently committed Oct 2, 2023
commit 5c5662dd9f2dd78ad80cd760c33406d98bd168d7
4 changes: 4 additions & 0 deletions Include/pybuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ PyAPI_FUNC(int) PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,

/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
PyAPI_FUNC(void) PyBuffer_Release(Py_buffer *view);
PyAPI_FUNC(int) PyUnstable_Buffer_ReleaseInInterpreter(
PyInterpreterState *interp, Py_buffer *view);
PyAPI_FUNC(int) PyUnstable_Buffer_ReleaseInInterpreterAndRawFree(
PyInterpreterState *interp, Py_buffer *view);

/* Maximum number of dimensions */
#define PyBUF_MAX_NDIM 64
Expand Down
21 changes: 21 additions & 0 deletions Objects/abstract.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,27 @@ PyBuffer_Release(Py_buffer *view)
Py_DECREF(obj);
}

static int
_buffer_release_call(void *arg)
{
PyBuffer_Release((Py_buffer *)arg);
return 0;
}

int
PyUnstable_Buffer_ReleaseInInterpreter(PyInterpreterState *interp,
Py_buffer *view)
{
return _Py_CallInInterpreter(interp, _buffer_release_call, view);
}

int
PyUnstable_Buffer_ReleaseInInterpreterAndRawFree(PyInterpreterState *interp,
Py_buffer *view)
{
return _Py_CallInInterpreterAndRawFree(interp, _buffer_release_call, view);
}

PyObject *
PyObject_Format(PyObject *obj, PyObject *format_spec)
{
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/pull/110246/commits/5c5662dd9f2dd78ad80cd760c33406d98bd168d7

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy