summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-21 02:12:22 (GMT)
committerGitHub <noreply@github.com>2017-11-21 02:12:22 (GMT)
commit25420fe290b98171e6d30edf9350292c21ef700e (patch)
tree265d725ef6c341501f38873266c91e7461fd0364 /Include
parent09f3a8a1249308a104a89041d82fe99e6c087043 (diff)
downloadcpython-25420fe290b98171e6d30edf9350292c21ef700e.zip
cpython-25420fe290b98171e6d30edf9350292c21ef700e.tar.gz
cpython-25420fe290b98171e6d30edf9350292c21ef700e.tar.bz2
bpo-32030: Add more options to _PyCoreConfig (#4485)
Py_Main() now handles two more -X options: * -X showrefcount: new _PyCoreConfig.show_ref_count field * -X showalloccount: new _PyCoreConfig.show_alloc_count field
Diffstat (limited to 'Include')
-rw-r--r--Include/object.h1
-rw-r--r--Include/pystate.h20
2 files changed, 12 insertions, 9 deletions
diff --git a/Include/object.h b/Include/object.h
index c65f948..7db5bfe 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -728,7 +728,6 @@ PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void);
/* Py_REF_DEBUG also controls the display of refcounts and memory block
* allocations at the interactive prompt and at interpreter shutdown
*/
-PyAPI_FUNC(PyObject *) _PyDebug_XOptionShowRefCount(void);
PyAPI_FUNC(void) _PyDebug_PrintTotalRefs(void);
#else
#define _Py_INC_REFTOTAL
diff --git a/Include/pystate.h b/Include/pystate.h
index 2081ff5..a3840c9 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -25,15 +25,17 @@ typedef PyObject* (*_PyFrameEvalFunction)(struct _frame *, int);
typedef struct {
- int ignore_environment;
- int use_hash_seed;
+ int ignore_environment; /* -E */
+ int use_hash_seed; /* PYTHONHASHSEED=x */
unsigned long hash_seed;
int _disable_importlib; /* Needed by freeze_importlib */
- char *allocator;
- int faulthandler;
- int tracemalloc; /* Number of saved frames, 0=don't trace */
- int importtime; /* -X importtime */
+ const char *allocator; /* Memory allocator: _PyMem_SetupAllocators() */
int dev_mode; /* -X dev */
+ int faulthandler; /* -X faulthandler */
+ int tracemalloc; /* -X tracemalloc=N */
+ int import_time; /* -X importtime */
+ int show_ref_count; /* -X showrefcount */
+ int show_alloc_count; /* -X showalloccount */
} _PyCoreConfig;
#define _PyCoreConfig_INIT \
@@ -42,10 +44,12 @@ typedef struct {
.hash_seed = 0, \
._disable_importlib = 0, \
.allocator = NULL, \
+ .dev_mode = 0, \
.faulthandler = 0, \
.tracemalloc = 0, \
- .importtime = 0, \
- .dev_mode = 0}
+ .import_time = 0, \
+ .show_ref_count = 0, \
+ .show_alloc_count = 0}
/* Placeholders while working on the new configuration API
*