aboutsummaryrefslogtreecommitdiff
path: root/Python/pyarena.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-03-24 02:23:01 +0100
committerGitHub <noreply@github.com>2021-03-24 02:23:01 +0100
commit8370e07e1e5b626e78ddc7aadbfaf248976c4454 (patch)
tree5ad56b80064a2e282bfd77442096ffab167de9ed /Python/pyarena.c
parent919d42d477093154a30b55d9d79f023dbbe5614a (diff)
downloadcpython3-8370e07e1e5b626e78ddc7aadbfaf248976c4454.tar.gz
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/pyarena.c')
-rw-r--r--Python/pyarena.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/pyarena.c b/Python/pyarena.c
index aefb787e55..ead03370d1 100644
--- a/Python/pyarena.c
+++ b/Python/pyarena.c
@@ -1,4 +1,5 @@
#include "Python.h"
+#include "pycore_pyarena.h" // PyArena
/* A simple arena block structure.
@@ -125,7 +126,7 @@ block_alloc(block *b, size_t size)
}
PyArena *
-PyArena_New()
+_PyArena_New(void)
{
PyArena* arena = (PyArena *)PyMem_Malloc(sizeof(PyArena));
if (!arena)
@@ -154,7 +155,7 @@ PyArena_New()
}
void
-PyArena_Free(PyArena *arena)
+_PyArena_Free(PyArena *arena)
{
assert(arena);
#if defined(Py_DEBUG)
@@ -177,7 +178,7 @@ PyArena_Free(PyArena *arena)
}
void *
-PyArena_Malloc(PyArena *arena, size_t size)
+_PyArena_Malloc(PyArena *arena, size_t size)
{
void *p = block_alloc(arena->a_cur, size);
if (!p)
@@ -200,7 +201,7 @@ PyArena_Malloc(PyArena *arena, size_t size)
}
int
-PyArena_AddPyObject(PyArena *arena, PyObject *obj)
+_PyArena_AddPyObject(PyArena *arena, PyObject *obj)
{
int r = PyList_Append(arena->a_objects, obj);
if (r >= 0) {