8000 [3.12] Add `extern "C"` around `PyTraceMalloc_` functions. (#127772) … · python/cpython@65bca19 · GitHub
[go: up one dir, main page]

Skip to content

Commit 65bca19

Browse files
vstinnerhawkinsp
andauthored
[3.12] Add extern "C" around PyTraceMalloc_ functions. (#127772) (#127817)
Add `extern "C"` around `PyTraceMalloc_` functions. (#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) Co-authored-by: Peter Hawkins <hawkinsp@cs.stanford.edu>
1 parent 0964f9f commit 65bca19

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)
0