@@ -24,42 +24,6 @@ PyAPI_FUNC(int) _PyMem_SetupAllocators(const char *opt);
2424/* Try to get the allocators name set by _PyMem_SetupAllocators(). */
2525PyAPI_FUNC (const char * ) _PyMem_GetAllocatorsName (void );
2626
27- /* Track an allocated memory block in the tracemalloc module.
28- Return 0 on success, return -1 on error (failed to allocate memory to store
29- the trace).
30-
31- Return -2 if tracemalloc is disabled.
32-
33- If memory block is already tracked, update the existing trace. */
34- PyAPI_FUNC (int ) PyTraceMalloc_Track (
35- unsigned int domain ,
36- uintptr_t ptr ,
37- size_t size );
38-
39- /* Update the Python traceback of an object.
40- This function can be used when a memory block is reused from a free list. */
41- PyAPI_FUNC (int ) _PyTraceMalloc_NewReference (PyObject * op );
42-
43- /* Untrack an allocated memory block in the tracemalloc module.
44- Do nothing if the block was not tracked.
45-
46- Return -2 if tracemalloc is disabled, otherwise return 0. */
47- PyAPI_FUNC (int ) PyTraceMalloc_Untrack (
48- unsigned int domain ,
49- uintptr_t ptr );
50-
51- /* Get the traceback where a memory block was allocated.
52-
53- Return a tuple of (filename: str, lineno: int) tuples.
54-
55- Return None if the tracemalloc module is disabled or if the memory block
56- is not tracked by tracemalloc.
57-
58- Raise an exception and return NULL on error. */
59- PyAPI_FUNC (PyObject * ) _PyTraceMalloc_GetTraceback (
60- unsigned int domain ,
61- uintptr_t ptr );
62-
6327PyAPI_FUNC (int ) _PyMem_IsFreed (void * ptr , size_t size );
6428#endif /* !defined(Py_LIMITED_API) */
6529
@@ -246,7 +210,9 @@ PyAPI_FUNC(int) _PyMem_SetDefaultAllocator(
246210
247211/* bpo-35053: expose _Py_tracemalloc_config for performance:
248212 _Py_NewReference() needs an efficient check to test if tracemalloc is
249- tracing. */
213+ tracing.
214+
215+ It has to be defined in pymem.h, before object.h is included. */
250216struct _PyTraceMalloc_Config {
251217 /* Module initialized?
252218 Variable protected by the GIL */
0 commit comments