Skip to content

Commit

Permalink
Add extern "C" around PyTraceMalloc_ functions. (python#127772)
Browse files Browse the repository at this point in the history
Pretty much everything else exported by Python.h has an extern "C"
annotation, yet this header appears to be missing one.
  • Loading branch information
hawkinsp authored Dec 11, 2024
1 parent db9bea0 commit 2cdeb61
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Include/cpython/tracemalloc.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef Py_LIMITED_API
#ifndef Py_TRACEMALLOC_H
#define Py_TRACEMALLOC_H
#ifdef __cplusplus
extern "C" {
#endif

/* Track an allocated memory block in the tracemalloc module.
Return 0 on success, return -1 on error (failed to allocate memory to store
Expand All @@ -22,5 +25,8 @@ PyAPI_FUNC(int) PyTraceMalloc_Untrack(
unsigned int domain,
uintptr_t ptr);

#ifdef __cplusplus
}
#endif
#endif // !Py_TRACEMALLOC_H
#endif // !Py_LIMITED_API

0 comments on commit 2cdeb61

Please sign in to comment.