Skip to content

Commit 64fa449

Browse files
authored
bpo-30866: Add _testcapi.stack_pointer() (#2601)
1 parent 3b69d91 commit 64fa449

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Modules/_testcapimodule.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4272,6 +4272,13 @@ test_pyobject_fastcallkeywords(PyObject *self, PyObject *args)
42724272
return _PyObject_FastCallKeywords(func, stack, nargs, kwnames);
42734273
}
42744274

4275+
static PyObject*
4276+
stack_pointer(PyObject *self, PyObject *args)
4277+
{
4278+
int v = 5;
4279+
return PyLong_FromVoidPtr(&v);
4280+
}
4281+
42754282

42764283
static PyMethodDef TestMethods[] = {
42774284
{"raise_exception", raise_exception, METH_VARARGS},
@@ -4485,6 +4492,7 @@ static PyMethodDef TestMethods[] = {
44854492
{"pyobject_fastcall", test_pyobject_fastcall, METH_VARARGS},
44864493
{"pyobject_fastcalldict", test_pyobject_fastcalldict, METH_VARARGS},
44874494
{"pyobject_fastcallkeywords", test_pyobject_fastcallkeywords, METH_VARARGS},
4495+
{"stack_pointer", stack_pointer, METH_NOARGS},
44884496
{NULL, NULL} /* sentinel */
44894497
};
44904498

0 commit comments

Comments
 (0)