mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
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.
This commit is contained in:
parent
d27eb1e406
commit
307186704d
8 changed files with 38 additions and 35 deletions
|
|
@ -440,17 +440,6 @@ test_pymem_alloc0(PyObject *self, PyObject *Py_UNUSED(ignored))
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue