summaryrefslogtreecommitdiffstats
path: root/Include/pystate.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-12-06 16:26:10 (GMT)
committerGitHub <noreply@github.com>2017-12-06 16:26:10 (GMT)
commit6bf992a1ac6f3f4d0f83ead9c6403a76afdbe6eb (patch)
tree592a2085a4d49a5fc394e96b4e3b57d25d82b38a /Include/pystate.h
parent672b6baa71010f236ee8c8ce912e98cb542385c6 (diff)
downloadcpython-6bf992a1ac6f3f4d0f83ead9c6403a76afdbe6eb.zip
cpython-6bf992a1ac6f3f4d0f83ead9c6403a76afdbe6eb.tar.gz
cpython-6bf992a1ac6f3f4d0f83ead9c6403a76afdbe6eb.tar.bz2
bpo-32030: Add pymain_get_global_config() (#4735)
* Py_Main() now starts by reading Py_xxx configuration variables to only work on its own private structure, and then later writes back the configuration into these variables. * Replace Py_GETENV() with pymain_get_env_var() which ignores empty variables. * Add _PyCoreConfig.dump_refs * Add _PyCoreConfig.malloc_stats * _PyObject_DebugMallocStats() is now responsible to check if debug hooks are installed. The function returns 1 if stats were written, or 0 if the hooks are disabled. Mark _PyMem_PymallocEnabled() as static.
Diffstat (limited to 'Include/pystate.h')
-rw-r--r--Include/pystate.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/Include/pystate.h b/Include/pystate.h
index cf45b05..d149aeb 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -36,6 +36,8 @@ typedef struct {
int import_time; /* -X importtime */
int show_ref_count; /* -X showrefcount */
int show_alloc_count; /* -X showalloccount */
+ int dump_refs; /* PYTHONDUMPREFS */
+ int malloc_stats; /* PYTHONMALLOCSTATS */
} _PyCoreConfig;
#define _PyCoreConfig_INIT (_PyCoreConfig){.use_hash_seed = -1}
@@ -111,7 +113,7 @@ typedef struct _is {
PyObject *after_forkers_child;
#endif
} PyInterpreterState;
-#endif
+#endif /* !Py_LIMITED_API */
/* State unique per thread */
@@ -133,7 +135,7 @@ typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *);
#define PyTrace_C_EXCEPTION 5
#define PyTrace_C_RETURN 6
#define PyTrace_OPCODE 7
-#endif
+#endif /* Py_LIMITED_API */
#ifdef Py_LIMITED_API
typedef struct _ts PyThreadState;
@@ -238,7 +240,7 @@ typedef struct _ts {
/* XXX signal handlers should also be here */
} PyThreadState;
-#endif
+#endif /* !Py_LIMITED_API */
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void);
@@ -363,7 +365,7 @@ PyAPI_FUNC(int) PyGILState_Check(void);
Return NULL before _PyGILState_Init() is called and after _PyGILState_Fini()
is called. */
PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void);
-#endif
+#endif /* !Py_LIMITED_API */
/* The implementation of sys._current_frames() Returns a dict mapping