File tree 4 files changed +16
-9
lines changed
4 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 52
52
the 1st step is performed automatically for you, so in a C++ class
53
53
constructor you would start directly with PyObject_Init/InitVar. */
54
54
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
-
63
55
64
56
typedef struct {
65
57
/* 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);
232
232
extern int _PyObject_IsInstanceDictEmpty (PyObject * );
233
233
extern PyObject * _PyType_GetSubclasses (PyTypeObject * );
234
234
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
+
235
244
#ifdef __cplusplus
236
245
}
237
246
#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 8
8
/* Defined in tracemalloc.c */
9
9
extern void _PyMem_DumpTraceback (int fd , const void * ptr );
10
10
11
+ // Forward declaration
12
+ int _PyObject_DebugMallocStats (FILE * out );
13
+
11
14
12
15
/* Python's malloc wrappers (see pymem.h) */
13
16
@@ -1569,8 +1572,9 @@ new_arena(void)
1569
1572
const char * opt = Py_GETENV ("PYTHONMALLOCSTATS" );
1570
1573
debug_stats = (opt != NULL && * opt != '\0' );
1571
1574
}
1572
- if (debug_stats )
1575
+ if (debug_stats ) {
1573
1576
_PyObject_DebugMallocStats (stderr );
1577
+ }
1574
1578
1575
1579
if (unused_arena_objects == NULL ) {
1576
1580
uint i ;
You can’t perform that action at this time.
0 commit comments