diff options
author | Victor Stinner <vstinner@python.org> | 2021-03-24 01:23:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 01:23:01 (GMT) |
commit | 8370e07e1e5b626e78ddc7aadbfaf248976c4454 (patch) | |
tree | 5ad56b80064a2e282bfd77442096ffab167de9ed /Python/pythonrun.c | |
parent | 919d42d477093154a30b55d9d79f023dbbe5614a (diff) | |
download | cpython-8370e07e1e5b626e78ddc7aadbfaf248976c4454.zip cpython-8370e07e1e5b626e78ddc7aadbfaf248976c4454.tar.gz cpython-8370e07e1e5b626e78ddc7aadbfaf248976c4454.tar.bz2 |
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()
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 79ff42b..b562875 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -247,7 +247,7 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, } } } - arena = PyArena_New(); + arena = _PyArena_New(); if (arena == NULL) { Py_XDECREF(v); Py_XDECREF(w); @@ -262,7 +262,7 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, Py_XDECREF(w); Py_XDECREF(oenc); if (mod == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); if (errcode == E_EOF) { PyErr_Clear(); return E_EOF; @@ -271,12 +271,12 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, } m = PyImport_AddModuleObject(mod_name); if (m == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); return -1; } d = PyModule_GetDict(m); v = run_mod(mod, filename, d, d, flags, arena); - PyArena_Free(arena); + _PyArena_Free(arena); if (v == NULL) { return -1; } @@ -1099,7 +1099,7 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, if (filename == NULL) return NULL; - arena = PyArena_New(); + arena = _PyArena_New(); if (arena == NULL) return NULL; @@ -1107,7 +1107,7 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, if (mod != NULL) ret = run_mod(mod, filename, globals, locals, flags, arena); - PyArena_Free(arena); + _PyArena_Free(arena); return ret; } @@ -1116,7 +1116,7 @@ static PyObject * pyrun_file(FILE *fp, PyObject *filename, int start, PyObject *globals, PyObject *locals, int closeit, PyCompilerFlags *flags) { - PyArena *arena = PyArena_New(); + PyArena *arena = _PyArena_New(); if (arena == NULL) { return NULL; } @@ -1136,7 +1136,7 @@ pyrun_file(FILE *fp, PyObject *filename, int start, PyObject *globals, else { ret = NULL; } - PyArena_Free(arena); + _PyArena_Free(arena); return ret; } @@ -1289,22 +1289,22 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start, { PyCodeObject *co; mod_ty mod; - PyArena *arena = PyArena_New(); + PyArena *arena = _PyArena_New(); if (arena == NULL) return NULL; mod = _PyParser_ASTFromString(str, filename, start, flags, arena); if (mod == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); return NULL; } if (flags && (flags->cf_flags & PyCF_ONLY_AST)) { PyObject *result = PyAST_mod2obj(mod); - PyArena_Free(arena); + _PyArena_Free(arena); return result; } co = _PyAST_Compile(mod, filename, flags, optimize, arena); - PyArena_Free(arena); + _PyArena_Free(arena); return (PyObject *)co; } |