Displaying 2 results from an estimated 2 matches for "4a96cf6".
2020 Sep 08
0
[libnbd PATCH] hack for testing python closure leaks: NOT FOR COMMIT
Just posting this for posterity, on something I used to track down
memory leaks related to python closures.
---
generator/Python.ml | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/generator/Python.ml b/generator/Python.ml
index 4a96cf6..2ff17dd 100644
--- a/generator/Python.ml
+++ b/generator/Python.ml
@@ -578,9 +578,27 @@ let generate_python_methods_c () =
pr " PyObject *buf; /* Optional pointer to persistent buffer. */\n";
pr "};\n";
pr "\n";
+ pr "static size_t alloc_count;\n&quo...
2020 Sep 08
2
[libnbd PATCH] python: Plug some memory leaks on error paths
...0, 1)'
which fails due to '1' not being callable, but leaked malloc'd memory
in the process.
---
generator/Python.ml | 55 +++++++++++++++++++++++++++++----------------
1 file changed, 36 insertions(+), 19 deletions(-)
diff --git a/generator/Python.ml b/generator/Python.ml
index 4a96cf6..9a22f9e 100644
--- a/generator/Python.ml
+++ b/generator/Python.ml
@@ -177,6 +177,7 @@ let print_python_closure_wrapper { cbname; cbargs } =
pr " Py_DECREF (py_%s_modname);\n" n;
pr " if (!py_%s_mod) { PyErr_PrintEx (0); return -1; }\n" n;
pr " P...