summaryrefslogtreecommitdiff
path: root/Modules/_testcapimodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-06-20 17:46:36 +0200
committerGitHub <noreply@github.com>2017-06-20 17:46:36 +0200
commit5ea4c0677389ead2eee759958694cff2c65834a7 (patch)
tree90e13f3ef6da418c459de164cb7f21e9ab70a1c9 /Modules/_testcapimodule.c
parent26cb4657bcc9a7adffa95798ececb588dddfeadb (diff)
downloadcpython-git-5ea4c0677389ead2eee759958694cff2c65834a7.tar.gz
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 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 8c44ad205b..83ba33dd7a 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -3958,15 +3958,15 @@ tracemalloc_track(PyObject *self, PyObject *args)
if (release_gil) {
Py_BEGIN_ALLOW_THREADS
- res = _PyTraceMalloc_Track(domain, (uintptr_t)ptr, size);
+ res = PyTraceMalloc_Track(domain, (uintptr_t)ptr, size);
Py_END_ALLOW_THREADS
}
else {
- res = _PyTraceMalloc_Track(domain, (uintptr_t)ptr, size);
+ res = PyTraceMalloc_Track(domain, (uintptr_t)ptr, size);
}
if (res < 0) {
- PyErr_SetString(PyExc_RuntimeError, "_PyTraceMalloc_Track error");
+ PyErr_SetString(PyExc_RuntimeError, "PyTraceMalloc_Track error");
return NULL;
}
@@ -3987,9 +3987,9 @@ tracemalloc_untrack(PyObject *self, PyObject *args)
if (PyErr_Occurred())
return NULL;
- res = _PyTraceMalloc_Untrack(domain, (uintptr_t)ptr);
+ res = PyTraceMalloc_Untrack(domain, (uintptr_t)ptr);
if (res < 0) {
- PyErr_SetString(PyExc_RuntimeError, "_PyTraceMalloc_Track error");
+ PyErr_SetString(PyExc_RuntimeError, "PyTraceMalloc_Untrack error");
return NULL;
}