mirror of
https://github.com/python/cpython.git
synced 2025-08-13 13:29:13 +00:00
GH-101520: Move tracemalloc functionality into core, leaving interface in Modules. (#104508)
This commit is contained in:
parent
26931944dd
commit
f7df173949
11 changed files with 1621 additions and 1545 deletions
|
@ -33,6 +33,40 @@ PyAPI_FUNC(int) PyTraceMalloc_Untrack(
|
|||
PyAPI_FUNC(PyObject*) _PyTraceMalloc_GetTraceback(
|
||||
unsigned int domain,
|
||||
uintptr_t ptr);
|
||||
|
||||
/* Return non-zero if tracemalloc is tracing */
|
||||
PyAPI_FUNC(int) _PyTraceMalloc_IsTracing(void);
|
||||
|
||||
/* Clear the tracemalloc traces */
|
||||
PyAPI_FUNC(void) _PyTraceMalloc_ClearTraces(void);
|
||||
|
||||
/* Clear the tracemalloc traces */
|
||||
PyAPI_FUNC(PyObject *) _PyTraceMalloc_GetTraces(void);
|
||||
|
||||
/* Clear tracemalloc traceback for an object */
|
||||
PyAPI_FUNC(PyObject *) _PyTraceMalloc_GetObjectTraceback(PyObject *obj);
|
||||
|
||||
/* Initialize tracemalloc */
|
||||
PyAPI_FUNC(int) _PyTraceMalloc_Init(void);
|
||||
|
||||
/* Start tracemalloc */
|
||||
PyAPI_FUNC(int) _PyTraceMalloc_Start(int max_nframe);
|
||||
|
||||
/* Stop tracemalloc */
|
||||
PyAPI_FUNC(void) _PyTraceMalloc_Stop(void);
|
||||
|
||||
/* Get the tracemalloc traceback limit */
|
||||
PyAPI_FUNC(int) _PyTraceMalloc_GetTracebackLimit(void);
|
||||
|
||||
/* Get the memory usage of tracemalloc in bytes */
|
||||
PyAPI_FUNC(size_t) _PyTraceMalloc_GetMemory(void);
|
||||
|
||||
/* Get the current size and peak size of traced memory blocks as a 2-tuple */
|
||||
PyAPI_FUNC(PyObject *) _PyTraceMalloc_GetTracedMemory(void);
|
||||
|
||||
/* Set the peak size of traced memory blocks to the current size */
|
||||
PyAPI_FUNC(void) _PyTraceMalloc_ResetPeak(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* !Py_TRACEMALLOC_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue