8000 gh-67565: remove redundant C-contiguity checks by furkanonder · Pull Request #105521 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-67565: remove redundant C-contiguity checks #105521

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 33 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
92dd958
remove redundant C-contiguity chec in getargs.c
furkanonder Jun 8, 2023
68a78dd
Merge branch 'main' into issue-67565
furkanonder Jun 8, 2023
8ab0fbd
📜🤖 Added by blurb_it.
blurb-it[bot] Jun 8, 2023
9453509
Merge branch 'main' into issue-67565
furkanonder Jun 8, 2023
6653612
Merge branch 'main' into issue-67565
furkanonder Aug 5, 2023
ce0fd8c
add whitespace between functions
furkanonder Aug 5, 2023
374f01a
remove redundant C-contiguity check in binascii
furkanonder Sep 6, 2023
36bee41
remove redundant C-contiguity check in ssl
furkanonder Sep 6, 2023
84b1a42
Merge branch 'main' into issue-67565
furkanonder Sep 7, 2023
8bbd6fa
mention binascii and ssl module
furkanonder Sep 10, 2023
657bc60
Remove PyBuffer_IsContiguous from Argument Clinic
furkanonder Sep 10, 2023
9c5215f
Merge branch 'issue-67565' of github.com:furkanonder/cpython into iss…
furkanonder Sep 10, 2023
9e6f9c3
remove trailing-whitespace in test_binascii
furkanonder Sep 10, 2023
4902c6a
Merge branch 'main' into issue-67565
furkanonder Sep 10, 2023
bcfd13b
update news entry
furkanonder Sep 11, 2023
1e953f3
Merge branch 'main' into issue-67565
furkanonder Sep 11, 2023
b86546f
Add assert for PyBuffer_IsContiguous in getargs.c
furkanonder Sep 25, 2023
7cb3b09
Add assert for PyBuffer_IsContiguous in binascii.c
furkanonder Sep 25, 2023
d2cbee5
Add assert for PyBuffer_IsContiguous _ssl.c
furkanonder Sep 25, 2023
dff0a4f
add comment that PyBUF_SIMPLE guarantees C-contiguous buffers
furkanonder Sep 25, 2023
d06be0a
Merge branch 'main' into issue-67565
furkanonder Sep 26, 2023
9ce050a
Merge branch 'main' into issue-67565
furkanonder Oct 16, 2023
9e17a07
add new test using NONCONTIG_WRITABLE
furkanonder Oct 16, 2023
9e99a83
add new test using NONCONTIG_READONLY
furkanonder Oct 16, 2023
64d9e8f
add new test using NONCONTIG_READONLY
furkanonder Oct 16, 2023
a90519e
remove whitespaces
furkanonder Oct 16, 2023
676dfa2
re-run argument clinic
furkanonder Oct 16, 2023
d4387b2
remove tests
furkanonder Oct 16, 2023
c4da7d5
Merge branch 'main' into issue-67565
furkanonder Oct 16, 2023
81ba023
resolve conflict
furkanonder Oct 17, 2023
ce031cb
Merge branch 'main' into issue-67565
furkanonder Oct 17, 2023
69ba12f
re-run argument clinic
furkanonder Oct 18, 2023
cbfc93a
Update Python/getargs.c
serhiy-storchaka Oct 20, 2023
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove redundant C-contiguity check in :file:`getargs.c`, :mod:`binascii`, :mod:`ssl` and Argument Clinic. Patched by Stefan Krah and Furkan Onder
14 changes: 1 addition & 13 deletions Modules/_blake2/clinic/blake2b_impl.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 1 addition & 13 deletions Modules/_blake2/clinic/blake2s_impl.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 1 addition & 21 deletions Modules/_io/clinic/bufferedio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions Modules/_io/clinic/bytesio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions Modules/_io/clinic/fileio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions Modules/_io/clinic/winconsoleio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions Modules/_multiprocessing/clinic/multiprocessing.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions Modules/_sqlite/clinic/blob.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions Modules/_sqlite/clinic/connection.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4133,7 +4133,8 @@ _ssl__SSLContext_load_verify_locations_impl(PySSLContext *self,
if (PyObject_GetBuffer(cadata, &buf, PyBUF_SIMPLE)) {
goto error;
}
if (!PyBuffer_IsContiguous(&buf, 'C') || buf.ndim > 1) {
assert(PyBuffer_IsContiguous(&buf, 'C'));
if (buf.ndim > 1) {
PyBuffer_Release(&buf);
PyErr_SetString(PyExc_TypeError,
"cadata should be a contiguous buffer with "
Expand Down
8 changes: 1 addition & 7 deletions Modules/binascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,7 @@ ascii_buffer_converter(PyObject *arg, Py_buffer *buf)
"not '%.100s'", Py_TYPE(arg)->tp_name);
return 0;
}
if (!PyBuffer_IsContiguous(buf, 'C')) {
PyErr_Format(PyExc_TypeError,
"argument should be a contiguous buffer, "
"not '%.100s'", Py_TYPE(arg)->tp_name);
PyBuffer_Release(buf);
return 0;
}
assert(PyBuffer_IsContiguous(buf, 'C'));
return Py_CLEANUP_SUPPORTED;
}

Expand Down
10 changes: 1 addition & 9 deletions Modules/cjkcodecs/clinic/multibytecodec.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions Modules/clinic/_bz2module.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading
0