Skip to content

Commit ae58d9d

Browse files
hawkinspvstinner
authored andcommitted
Add extern "C" around PyTraceMalloc_ functions. (python#127772)
Pretty much everything else exported by Python.h has an extern "C" annotation, yet this header appears to be missing one. (cherry picked from commit 2cdeb61)
1 parent 487a51a commit ae58d9d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Include/tracemalloc.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#ifndef Py_TRACEMALLOC_H
22
#define Py_TRACEMALLOC_H
3+
#ifdef __cplusplus
4+
extern "C" {
5+
#endif
36

47
#ifndef Py_LIMITED_API
58
/* Track an allocated memory block in the tracemalloc module.
@@ -67,6 +70,8 @@ PyAPI_FUNC(PyObject *) _PyTraceMalloc_GetTracedMemory(void);
6770
/* Set the peak size of traced memory blocks to the current size */
6871
PyAPI_FUNC(void) _PyTraceMalloc_ResetPeak(void);
6972

73+
#ifdef __cplusplus
74+
}
7075
#endif
71-
76+
#endif /* !Py_LIMITED_API */
7277
#endif /* !Py_TRACEMALLOC_H */

0 commit comments

Comments
 (0)