diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-07-10 12:37:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-10 12:37:49 (GMT) |
commit | 64fa449f559b0e7b0480a177000419a78ebcf3ff (patch) | |
tree | 715b9da411b0caa5cfbcbe140e3856f8aec7ad4a | |
parent | 3b69d911c57ef591ac0c0f47a66dbcad8337f33a (diff) | |
download | cpython-64fa449f559b0e7b0480a177000419a78ebcf3ff.zip cpython-64fa449f559b0e7b0480a177000419a78ebcf3ff.tar.gz cpython-64fa449f559b0e7b0480a177000419a78ebcf3ff.tar.bz2 |
bpo-30866: Add _testcapi.stack_pointer() (#2601)
-rw-r--r-- | Modules/_testcapimodule.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index c9c2798..6556690 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -4272,6 +4272,13 @@ test_pyobject_fastcallkeywords(PyObject *self, PyObject *args) return _PyObject_FastCallKeywords(func, stack, nargs, kwnames); } +static PyObject* +stack_pointer(PyObject *self, PyObject *args) +{ + int v = 5; + return PyLong_FromVoidPtr(&v); +} + static PyMethodDef TestMethods[] = { {"raise_exception", raise_exception, METH_VARARGS}, @@ -4485,6 +4492,7 @@ static PyMethodDef TestMethods[] = { {"pyobject_fastcall", test_pyobject_fastcall, METH_VARARGS}, {"pyobject_fastcalldict", test_pyobject_fastcalldict, METH_VARARGS}, {"pyobject_fastcallkeywords", test_pyobject_fastcallkeywords, METH_VARARGS}, + {"stack_pointer", stack_pointer, METH_NOARGS}, {NULL, NULL} /* sentinel */ }; |