summaryrefslogtreecommitdiffstats
path: root/Include/pymem.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-05 00:11:10 (GMT)
committerGitHub <noreply@github.com>2020-02-05 00:11:10 (GMT)
commit40e547dfbb9052ca0c667b242f6825ed1c23c195 (patch)
treeaebb9f8925156ed5a97bbd0daddb43e4c03e2839 /Include/pymem.h
parent2545fa87628b4caca519da8aeb0eeef368b9dc0d (diff)
downloadcpython-40e547dfbb9052ca0c667b242f6825ed1c23c195.zip
cpython-40e547dfbb9052ca0c667b242f6825ed1c23c195.tar.gz
cpython-40e547dfbb9052ca0c667b242f6825ed1c23c195.tar.bz2
bpo-39542: Make _Py_NewReference() opaque in C API (GH-18346)
_Py_NewReference() becomes a regular opaque function, rather than a static inline function in the C API (object.h), to better hide implementation details. Move _Py_tracemalloc_config from public pymem.h to internal pycore_pymem.h header. Make _Py_AddToAllObjects() private.
Diffstat (limited to 'Include/pymem.h')
-rw-r--r--Include/pymem.h35
1 files changed, 0 insertions, 35 deletions
diff --git a/Include/pymem.h b/Include/pymem.h
index 07b380a..607feb9 100644
--- a/Include/pymem.h
+++ b/Include/pymem.h
@@ -101,41 +101,6 @@ PyAPI_FUNC(void) PyMem_Free(void *ptr);
#define PyMem_Del PyMem_Free
#define PyMem_DEL PyMem_FREE
-/* bpo-35053: expose _Py_tracemalloc_config for performance:
- _Py_NewReference() needs an efficient check to test if tracemalloc is
- tracing.
-
- It has to be defined in pymem.h, before object.h is included. */
-struct _PyTraceMalloc_Config {
- /* Module initialized?
- Variable protected by the GIL */
- enum {
- TRACEMALLOC_NOT_INITIALIZED,
- TRACEMALLOC_INITIALIZED,
- TRACEMALLOC_FINALIZED
- } initialized;
-
- /* Is tracemalloc tracing memory allocations?
- Variable protected by the GIL */
- int tracing;
-
- /* limit of the number of frames in a traceback, 1 by default.
- Variable protected by the GIL. */
- int max_nframe;
-
- /* use domain in trace key?
- Variable protected by the GIL. */
- int use_domain;
-};
-
-PyAPI_DATA(struct _PyTraceMalloc_Config) _Py_tracemalloc_config;
-
-#define _PyTraceMalloc_Config_INIT \
- {.initialized = TRACEMALLOC_NOT_INITIALIZED, \
- .tracing = 0, \
- .max_nframe = 1, \
- .use_domain = 0}
-
#ifndef Py_LIMITED_API
# define Py_CPYTHON_PYMEM_H