File tree Expand file tree Collapse file tree 4 files changed +16
-9
lines changed
Expand file tree Collapse file tree 4 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 5252 the 1st step is performed automatically for you, so in a C++ class
5353 constructor you would start directly with PyObject_Init/InitVar. */
5454
55- /* This function returns the number of allocated memory blocks, regardless of size */
56- PyAPI_FUNC (Py_ssize_t ) _Py_GetAllocatedBlocks (void );
57-
58- /* Macros */
59- #ifdef WITH_PYMALLOC
60- PyAPI_FUNC (int ) _PyObject_DebugMallocStats (FILE * out );
61- #endif
62-
6355
6456typedef struct {
6557 /* user context passed as the first argument to the 2 functions */
Original file line number Diff line number Diff line change @@ -232,6 +232,15 @@ extern void _PyObject_FreeInstanceAttributes(PyObject *self);
232232extern int _PyObject_IsInstanceDictEmpty (PyObject * );
233233extern PyObject * _PyType_GetSubclasses (PyTypeObject * );
234234
235+ /* This function returns the number of allocated memory blocks, regardless of size */
236+ PyAPI_FUNC (Py_ssize_t ) _Py_GetAllocatedBlocks (void );
237+
238+ /* Macros */
239+ #ifdef WITH_PYMALLOC
240+ // Export the symbol for the 3rd party guppy3 project
241+ PyAPI_FUNC (int ) _PyObject_DebugMallocStats (FILE * out );
242+ #endif
243+
235244#ifdef __cplusplus
236245}
237246#endif
Original file line number Diff line number Diff line change 1+ Move _Py_GetAllocatedBlocks() and _PyObject_DebugMallocStats() private
2+ functions to the internal C API. Patch by Victor Stinner.
Original file line number Diff line number Diff line change 88/* Defined in tracemalloc.c */
99extern void _PyMem_DumpTraceback (int fd , const void * ptr );
1010
11+ // Forward declaration
12+ int _PyObject_DebugMallocStats (FILE * out );
13+
1114
1215/* Python's malloc wrappers (see pymem.h) */
1316
@@ -1569,8 +1572,9 @@ new_arena(void)
15691572 const char * opt = Py_GETENV ("PYTHONMALLOCSTATS" );
15701573 debug_stats = (opt != NULL && * opt != '\0' );
15711574 }
1572- if (debug_stats )
1575+ if (debug_stats ) {
15731576 _PyObject_DebugMallocStats (stderr );
1577+ }
15741578
15751579 if (unused_arena_objects == NULL ) {
15761580 uint i ;
You can’t perform that action at this time.
0 commit comments