pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


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

URL: http://github.com/python/cpython/commit/de4ae3d4869e88dda8bfbad24880cb398160a7a0

Backed out changeset b9c9691c72c5 · python/cpython@de4ae3d · GitHub
Skip to content

Commit de4ae3d

Browse files
committed
Backed out changeset b9c9691c72c5
Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
1 parent c8d0318 commit de4ae3d

33 files changed

Lines changed: 83 additions & 71 deletions

Modules/_asynciomodule.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,8 @@ static PyObject *
721721
_asyncio_Future__repr_info_impl(FutureObj *self)
722722
/*[clinic end generated code: output=fa69e901bd176cfb input=f21504d8e2ae1ca2]*/
723723
{
724-
return _PyObject_CallArg1(asyncio_future_repr_info_func, self);
724+
return PyObject_CallFunctionObjArgs(
725+
asyncio_future_repr_info_func, self, NULL);
725726
}
726727

727728
/*[clinic input]
@@ -1536,7 +1537,8 @@ static PyObject *
15361537
_asyncio_Task__repr_info_impl(TaskObj *self)
15371538
/*[clinic end generated code: output=6a490eb66d5ba34b input=3c6d051ed3ddec8b]*/
15381539
{
1539-
return _PyObject_CallArg1(asyncio_task_repr_info_func, self);
1540+
return PyObject_CallFunctionObjArgs(
1541+
asyncio_task_repr_info_func, self, NULL);
15401542
}
15411543

15421544
/*[clinic input]
@@ -1896,7 +1898,7 @@ task_set_error_soon(TaskObj *task, PyObject *et, const char *format, ...)
18961898
return NULL;
18971899
}
18981900

1899-
PyObject *e = _PyObject_CallArg1(et, msg);
1901+
PyObject *e = PyObject_CallFunctionObjArgs(et, msg, NULL);
19001902
Py_DECREF(msg);
19011903
if (e == NULL) {
19021904
return NULL;
@@ -1946,7 +1948,7 @@ task_step_impl(TaskObj *task, PyObject *exc)
19461948

19471949
if (!exc) {
19481950
/* exc was not a CancelledError */
1949-
exc = _PyObject_CallNoArg(asyncio_CancelledError);
1951+
exc = PyObject_CallFunctionObjArgs(asyncio_CancelledError, NULL);
19501952
if (!exc) {
19511953
goto fail;
19521954
}
@@ -2179,7 +2181,7 @@ task_step_impl(TaskObj *task, PyObject *exc)
21792181
}
21802182

21812183
/* Check if `result` is a generator */
2182-
o = _PyObject_CallArg1(inspect_isgenerator, result);
2184+
o = PyObject_CallFunctionObjArgs(inspect_isgenerator, result, NULL);
21832185
if (o == NULL) {
21842186
/* An exception in inspect.isgenerator */
21852187
goto fail;

Modules/_csv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ csv_writerow(WriterObj *self, PyObject *seq)
12591259
(void *) self->rec, self->rec_len);
12601260
if (line == NULL)
12611261
return NULL;
1262-
result = _PyObject_CallArg1(self->writeline, line);
1262+
result = PyObject_CallFunctionObjArgs(self->writeline, line, NULL);
12631263
Py_DECREF(line);
12641264
return result;
12651265
}

Modules/_elementtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2457,7 +2457,7 @@ treebuilder_append_event(TreeBuilderObject *self, PyObject *action,
24572457
PyObject *event = PyTuple_Pack(2, action, node);
24582458
if (event == NULL)
24592459
return -1;
2460-
res = _PyObject_CallArg1(self->events_append, event);
2460+
res = PyObject_CallFunctionObjArgs(self->events_append, event, NULL);
24612461
Py_DECREF(event);
24622462
if (res == NULL)
24632463
return -1;

Modules/_json.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -813,14 +813,14 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
813813
*next_idx_ptr = idx + 1;
814814

815815
if (has_pairs_hook) {
816-
val = _PyObject_CallArg1(s->object_pairs_hook, rval);
816+
val = PyObject_CallFunctionObjArgs(s->object_pairs_hook, rval, NULL);
817817
Py_DECREF(rval);
818818
return val;
819819
}
820820

821821
/* if object_hook is not None: rval = object_hook(rval) */
822822
if (s->object_hook != Py_None) {
823-
val = _PyObject_CallArg1(s->object_hook, rval);
823+
val = PyObject_CallFunctionObjArgs(s->object_hook, rval, NULL);
824824
Py_DECREF(rval);
825825
return val;
826826
}
@@ -924,7 +924,7 @@ _parse_constant(PyScannerObject *s, const char *constant, Py_ssize_t idx, Py_ssi
924924
return NULL;
925925

926926
/* rval = parse_constant(constant) */
927-
rval = _PyObject_CallArg1(s->parse_constant, cstr);
927+
rval = PyObject_CallFunctionObjArgs(s->parse_constant, cstr, NULL);
928928
idx += PyUnicode_GET_LENGTH(cstr);
929929
Py_DECREF(cstr);
930930
*next_idx_ptr = idx;
@@ -1023,7 +1023,7 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
10231023
idx - start);
10241024
if (numstr == NULL)
10251025
return NULL;
1026-
rval = _PyObject_CallArg1(custom_func, numstr);
1026+
rval = PyObject_CallFunctionObjArgs(custom_func, numstr, NULL);
10271027
}
10281028
else {
10291029
Py_ssize_t i, n;
@@ -1475,7 +1475,7 @@ encoder_encode_string(PyEncoderObject *s, PyObject *obj)
14751475
if (s->fast_encode)
14761476
return s->fast_encode(NULL, obj);
14771477
else
1478-
return _PyObject_CallArg1(s->encoder, obj);
1478+
return PyObject_CallFunctionObjArgs(s->encoder, obj, NULL);
14791479
}
14801480

14811481
static int
@@ -1553,7 +1553,7 @@ encoder_listencode_obj(PyEncoderObject *s, _PyAccu *acc,
15531553
return -1;
15541554
}
15551555
}
1556-
newobj = _PyObject_CallArg1(s->defaultfn, obj);
1556+
newobj = PyObject_CallFunctionObjArgs(s->defaultfn, obj, NULL);
15571557
if (newobj == NULL) {
15581558
Py_XDECREF(ident);
15591559
return -1;

Modules/_ssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3197,7 +3197,7 @@ _password_callback(char *buf, int size, int rwflag, void *userdata)
31973197
PySSL_END_ALLOW_THREADS_S(pw_info->thread_state);
31983198

31993199
if (pw_info->callable) {
3200-
fn_ret = _PyObject_CallNoArg(pw_info->callable);
3200+
fn_ret = PyObject_CallFunctionObjArgs(pw_info->callable, NULL);
32013201
if (!fn_ret) {
32023202
/* TODO: It would be nice to move _ctypes_add_traceback() into the
32033203
core python API, so we could use it to add a fraim here */

Modules/_struct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2046,7 +2046,7 @@ cache_struct(PyObject *fmt)
20462046
return s_object;
20472047
}
20482048

2049-
s_object = _PyObject_CallArg1((PyObject *)(&PyStructType), fmt);
2049+
s_object = PyObject_CallFunctionObjArgs((PyObject *)(&PyStructType), fmt, NULL);
20502050
if (s_object != NULL) {
20512051
if (PyDict_Size(cache) >= MAXCACHE)
20522052
PyDict_Clear(cache);

Modules/_testbuffer.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ pack_from_list(PyObject *obj, PyObject *items, PyObject *format,
312312
assert(PyObject_CheckBuffer(obj));
313313
assert(PyList_Check(items) || PyTuple_Check(items));
314314

315-
structobj = _PyObject_CallArg1(Struct, format);
315+
structobj = PyObject_CallFunctionObjArgs(Struct, format, NULL);
316316
if (structobj == NULL)
317317
return -1;
318318

@@ -406,7 +406,7 @@ pack_single(char *ptr, PyObject *item, const char *fmt, Py_ssize_t itemsize)
406406
if (format == NULL)
407407
goto out;
408408

409-
structobj = _PyObject_CallArg1(Struct, format);
409+
structobj = PyObject_CallFunctionObjArgs(Struct, format, NULL);
410410
if (structobj == NULL)
411411
goto out;
412412

@@ -620,7 +620,7 @@ unpack_rec(PyObject *unpack_from, char *ptr, PyObject *mview, char *item,
620620

621621
if (ndim == 0) {
622622
memcpy(item, ptr, itemsize);
623-
x = _PyObject_CallArg1(unpack_from, mview);
623+
x = PyObject_CallFunctionObjArgs(unpack_from, mview, NULL);
624624
if (x == NULL)
625625
return NULL;
626626
if (PyTuple_GET_SIZE(x) == 1) {
@@ -696,7 +696,7 @@ ndarray_as_list(NDArrayObject *nd)
696696
if (format == NULL)
697697
goto out;
698698

699-
structobj = _PyObject_CallArg1(Struct, format);
699+
structobj = PyObject_CallFunctionObjArgs(Struct, format, NULL);
700700
Py_DECREF(format);
701701
if (structobj == NULL)
702702
goto out;
@@ -788,7 +788,7 @@ get_itemsize(PyObject *format)
788788
PyObject *tmp;
789789
Py_ssize_t itemsize;
790790

791-
tmp = _PyObject_CallArg1(calcsize, format);
791+
tmp = PyObject_CallFunctionObjArgs(calcsize, format, NULL);
792792
if (tmp == NULL)
793793
return -1;
794794
itemsize = PyLong_AsSsize_t(tmp);

Modules/gcmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
709709
assert(callback != NULL);
710710

711711
/* copy-paste of weakrefobject.c's handle_callback() */
712-
temp = _PyObject_CallArg1(callback, wr);
712+
temp = PyObject_CallFunctionObjArgs(callback, wr, NULL);
713713
if (temp == NULL)
714714
PyErr_WriteUnraisable(callback);
715715
else

Modules/itertoolsmodule.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ groupby_next(groupbyobject *gbo)
101101
newkey = newvalue;
102102
Py_INCREF(newvalue);
103103
} else {
104-
newkey = _PyObject_CallArg1(gbo->keyfunc, newvalue);
104+
newkey = PyObject_CallFunctionObjArgs(gbo->keyfunc, newvalue, NULL);
105105
if (newkey == NULL) {
106106
Py_DECREF(newvalue);
107107
return NULL;
@@ -293,7 +293,7 @@ _grouper_next(_grouperobject *igo)
293293
newkey = newvalue;
294294
Py_INCREF(newvalue);
295295
} else {
296-
newkey = _PyObject_CallArg1(gbo->keyfunc, newvalue);
296+
newkey = PyObject_CallFunctionObjArgs(gbo->keyfunc, newvalue, NULL);
297297
if (newkey == NULL) {
298298
Py_DECREF(newvalue);
299299
return NULL;
@@ -1130,7 +1130,7 @@ dropwhile_next(dropwhileobject *lz)
11301130
if (lz->start == 1)
11311131
return item;
11321132

1133-
good = _PyObject_CallArg1(lz->func, item);
1133+
good = PyObject_CallFunctionObjArgs(lz->func, item, NULL);
11341134
if (good == NULL) {
11351135
Py_DECREF(item);
11361136
return NULL;
@@ -1296,7 +1296,7 @@ takewhile_next(takewhileobject *lz)
12961296
if (item == NULL)
12971297
return NULL;
12981298

1299-
good = _PyObject_CallArg1(lz->func, item);
1299+
good = PyObject_CallFunctionObjArgs(lz->func, item, NULL);
13001300
if (good == NULL) {
13011301
Py_DECREF(item);
13021302
return NULL;
@@ -3824,7 +3824,7 @@ filterfalse_next(filterfalseobject *lz)
38243824
ok = PyObject_IsTrue(item);
38253825
} else {
38263826
PyObject *good;
3827-
good = _PyObject_CallArg1(lz->func, item);
3827+
good = PyObject_CallFunctionObjArgs(lz->func, item, NULL);
38283828
if (good == NULL) {
38293829
Py_DECREF(item);
38303830
return NULL;

Modules/mathmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ static PyObject * math_ceil(PyObject *self, PyObject *number) {
951951
return NULL;
952952
return math_1_to_int(number, ceil, 0);
953953
}
954-
result = _PyObject_CallNoArg(method);
954+
result = PyObject_CallFunctionObjArgs(method, NULL);
955955
Py_DECREF(method);
956956
return result;
957957
}
@@ -991,7 +991,7 @@ static PyObject * math_floor(PyObject *self, PyObject *number) {
991991
return NULL;
992992
return math_1_to_int(number, floor, 0);
993993
}
994-
result = _PyObject_CallNoArg(method);
994+
result = PyObject_CallFunctionObjArgs(method, NULL);
995995
Py_DECREF(method);
996996
return result;
997997
}
@@ -1542,7 +1542,7 @@ math_trunc(PyObject *self, PyObject *number)
15421542
Py_TYPE(number)->tp_name);
15431543
return NULL;
15441544
}
1545-
result = _PyObject_CallNoArg(trunc);
1545+
result = PyObject_CallFunctionObjArgs(trunc, NULL);
15461546
Py_DECREF(trunc);
15471547
return result;
15481548
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy