summaryrefslogtreecommitdiffstats
path: root/Include/pymem.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-06-20 15:46:36 (GMT)
committerGitHub <noreply@github.com>2017-06-20 15:46:36 (GMT)
commit5ea4c0677389ead2eee759958694cff2c65834a7 (patch)
tree90e13f3ef6da418c459de164cb7f21e9ab70a1c9 /Include/pymem.h
parent26cb4657bcc9a7adffa95798ececb588dddfeadb (diff)
downloadcpython-5ea4c0677389ead2eee759958694cff2c65834a7.zip
cpython-5ea4c0677389ead2eee759958694cff2c65834a7.tar.gz
cpython-5ea4c0677389ead2eee759958694cff2c65834a7.tar.bz2
bpo-30054: Expose tracemalloc C API (#1236)
* Make PyTraceMalloc_Track() and PyTraceMalloc_Untrack() functions public (remove the "_" prefix) * Remove the _PyTraceMalloc_domain_t type: use directly unsigned int. * Document methods Note: methods are already tested in test_tracemalloc.
Diffstat (limited to 'Include/pymem.h')
-rw-r--r--Include/pymem.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/Include/pymem.h b/Include/pymem.h
index a7eb4d2..2170e0f 100644
--- a/Include/pymem.h
+++ b/Include/pymem.h
@@ -25,9 +25,6 @@ PyAPI_FUNC(int) _PyMem_SetupAllocators(const char *opt);
PyAPI_FUNC(int) _PyMem_PymallocEnabled(void);
#endif
-/* Identifier of an address space (domain) in tracemalloc */
-typedef unsigned int _PyTraceMalloc_domain_t;
-
/* Track an allocated memory block in the tracemalloc module.
Return 0 on success, return -1 on error (failed to allocate memory to store
the trace).
@@ -35,8 +32,8 @@ typedef unsigned int _PyTraceMalloc_domain_t;
Return -2 if tracemalloc is disabled.
If memory block is already tracked, update the existing trace. */
-PyAPI_FUNC(int) _PyTraceMalloc_Track(
- _PyTraceMalloc_domain_t domain,
+PyAPI_FUNC(int) PyTraceMalloc_Track(
+ unsigned int domain,
uintptr_t ptr,
size_t size);
@@ -44,8 +41,8 @@ PyAPI_FUNC(int) _PyTraceMalloc_Track(
Do nothing if the block was not tracked.
Return -2 if tracemalloc is disabled, otherwise return 0. */
-PyAPI_FUNC(int) _PyTraceMalloc_Untrack(
- _PyTraceMalloc_domain_t domain,
+PyAPI_FUNC(int) PyTraceMalloc_Untrack(
+ unsigned int domain,
uintptr_t ptr);
/* Get the traceback where a memory block was allocated.
@@ -57,7 +54,7 @@ PyAPI_FUNC(int) _PyTraceMalloc_Untrack(
Raise an exception and return NULL on error. */
PyAPI_FUNC(PyObject*) _PyTraceMalloc_GetTraceback(
- _PyTraceMalloc_domain_t domain,
+ unsigned int domain,
uintptr_t ptr);
#endif /* !Py_LIMITED_API */