mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
bpo-43244: Remove the pyarena.h header (GH-25007)
Remove the pyarena.h header file with functions: * PyArena_New() * PyArena_Free() * PyArena_Malloc() * PyArena_AddPyObject() These functions were undocumented, excluded from the limited C API, and were only used internally by the compiler. Add pycore_pyarena.h header. Rename functions: * PyArena_New() => _PyArena_New() * PyArena_Free() => _PyArena_Free() * PyArena_Malloc() => _PyArena_Malloc() * PyArena_AddPyObject() => _PyArena_AddPyObject()
This commit is contained in:
parent
919d42d477
commit
8370e07e1e
20 changed files with 215 additions and 187 deletions
|
|
@ -362,7 +362,7 @@ class FunctionVisitor(PrototypeVisitor):
|
|||
emit('return NULL;', 2)
|
||||
emit('}', 1)
|
||||
|
||||
emit("p = (%s)PyArena_Malloc(arena, sizeof(*p));" % ctype, 1);
|
||||
emit("p = (%s)_PyArena_Malloc(arena, sizeof(*p));" % ctype, 1);
|
||||
emit("if (!p)", 1)
|
||||
emit("return NULL;", 2)
|
||||
if union:
|
||||
|
|
@ -946,7 +946,7 @@ static int obj2ast_object(struct ast_state *Py_UNUSED(state), PyObject* obj, PyO
|
|||
if (obj == Py_None)
|
||||
obj = NULL;
|
||||
if (obj) {
|
||||
if (PyArena_AddPyObject(arena, obj) < 0) {
|
||||
if (_PyArena_AddPyObject(arena, obj) < 0) {
|
||||
*out = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -958,7 +958,7 @@ static int obj2ast_object(struct ast_state *Py_UNUSED(state), PyObject* obj, PyO
|
|||
|
||||
static int obj2ast_constant(struct ast_state *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena)
|
||||
{
|
||||
if (PyArena_AddPyObject(arena, obj) < 0) {
|
||||
if (_PyArena_AddPyObject(arena, obj) < 0) {
|
||||
*out = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue