1 #ifndef Py_LIMITED_API 2 #ifndef Py_TRACEMALLOC_H 3 #define Py_TRACEMALLOC_H 4 5 /* Track an allocated memory block in the tracemalloc module. 6 Return 0 on success, return -1 on error (failed to allocate memory to store 7 the trace). 8 9 Return -2 if tracemalloc is disabled. 10 11 If memory block is already tracked, update the existing trace. */ 12 PyAPI_FUNC(int) PyTraceMalloc_Track( 13 unsigned int domain, 14 uintptr_t ptr, 15 size_t size); 16 17 /* Untrack an allocated memory block in the tracemalloc module. 18 Do nothing if the block was not tracked. 19 20 Return -2 if tracemalloc is disabled, otherwise return 0. */ 21 PyAPI_FUNC(int) PyTraceMalloc_Untrack( 22 unsigned int domain, 23 uintptr_t ptr); 24 25 #endif // !Py_TRACEMALLOC_H 26 #endif // !Py_LIMITED_API 27