diff options
author | Victor Stinner <vstinner@python.org> | 2023-07-24 18:48:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-24 18:48:06 (GMT) |
commit | 307186704d8327d6c67b0650e49b125758a25bbc (patch) | |
tree | bc16b1afa6e77c8d5f9c9b276a4f0f6483c950de /Modules/_testcapi | |
parent | d27eb1e406a8789d9eaba6dbfed5c2e5abe294fd (diff) | |
download | cpython-307186704d8327d6c67b0650e49b125758a25bbc.zip cpython-307186704d8327d6c67b0650e49b125758a25bbc.tar.gz cpython-307186704d8327d6c67b0650e49b125758a25bbc.tar.bz2 |
gh-106320: Remove private _PyMem API (#107187)
Move private _PyMem functions to the internal C API (pycore_pymem.h):
* _PyMem_GetCurrentAllocatorName()
* _PyMem_RawStrdup()
* _PyMem_RawWcsdup()
* _PyMem_Strdup()
No longer export these functions.
Move pymem_getallocatorsname() function from _testcapi to _testinternalcapi,
since the API moved to the internal C API.
Diffstat (limited to 'Modules/_testcapi')
-rw-r--r-- | Modules/_testcapi/mem.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/Modules/_testcapi/mem.c b/Modules/_testcapi/mem.c index 0b2b1cd..ef9234d 100644 --- a/Modules/_testcapi/mem.c +++ b/Modules/_testcapi/mem.c @@ -441,17 +441,6 @@ test_pymem_alloc0(PyObject *self, PyObject *Py_UNUSED(ignored)) } static PyObject * -test_pymem_getallocatorsname(PyObject *self, PyObject *args) -{ - const char *name = _PyMem_GetCurrentAllocatorName(); - if (name == NULL) { - PyErr_SetString(PyExc_RuntimeError, "cannot get allocators name"); - return NULL; - } - return PyUnicode_FromString(name); -} - -static PyObject * test_pymem_setrawallocators(PyObject *self, PyObject *Py_UNUSED(ignored)) { return test_setallocators(PYMEM_DOMAIN_RAW); @@ -589,7 +578,6 @@ tracemalloc_untrack(PyObject *self, PyObject *args) static PyMethodDef test_methods[] = { {"pymem_api_misuse", pymem_api_misuse, METH_NOARGS}, {"pymem_buffer_overflow", pymem_buffer_overflow, METH_NOARGS}, - {"pymem_getallocatorsname", test_pymem_getallocatorsname, METH_NOARGS}, {"pymem_malloc_without_gil", pymem_malloc_without_gil, METH_NOARGS}, {"pyobject_malloc_without_gil", pyobject_malloc_without_gil, METH_NOARGS}, {"remove_mem_hooks", remove_mem_hooks, METH_NOARGS, |