summaryrefslogtreecommitdiff
path: root/Include/internal/pycore_long.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal/pycore_long.h')
-rw-r--r--Include/internal/pycore_long.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/Include/internal/pycore_long.h b/Include/internal/pycore_long.h
index b9f926996d..a5639ceb69 100644
--- a/Include/internal/pycore_long.h
+++ b/Include/internal/pycore_long.h
@@ -8,18 +8,28 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif
-#include "pycore_interp.h" // PyInterpreterState.small_ints
+#include "pycore_long_state.h" // _PyLong_SMALL_INTS
#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "pycore_runtime.h" // _PyRuntime
+
+
+/* runtime lifecycle */
+
+extern void _PyLong_InitGlobalObjects(PyInterpreterState *);
+extern PyStatus _PyLong_InitTypes(PyInterpreterState *);
+
+
+/* other API */
// Return a borrowed reference to the zero singleton.
// The function cannot return NULL.
static inline PyObject* _PyLong_GetZero(void)
-{ return (PyObject *)&_PyRuntime.small_ints[_PY_NSMALLNEGINTS]; }
+{ return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; }
// Return a borrowed reference to the one singleton.
// The function cannot return NULL.
static inline PyObject* _PyLong_GetOne(void)
-{ return (PyObject *)&_PyRuntime.small_ints[_PY_NSMALLNEGINTS+1]; }
+{ return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+1]; }
PyObject *_PyLong_Add(PyLongObject *left, PyLongObject *right);
PyObject *_PyLong_Multiply(PyLongObject *left, PyLongObject *right);