[Python-checkins] Remove an old, elementtree-specific leak detector (GH-31811)

ericvsmith webhook-mailer at python.org
Fri Mar 11 09:47:49 EST 2022


https://github.com/python/cpython/commit/f84c867dd7c87c49d830e5d195a13afe7eb86caa
commit: f84c867dd7c87c49d830e5d195a13afe7eb86caa
branch: main
author: Oleg Iarygin <oleg at arhadthedev.net>
committer: ericvsmith <ericvsmith at users.noreply.github.com>
date: 2022-03-11T09:47:42-05:00
summary:

Remove an old, elementtree-specific leak detector (GH-31811)

files:
M Modules/_elementtree.c

diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index f54c28447ca8f..1794124aa45ad 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -36,17 +36,6 @@
 
 /* -------------------------------------------------------------------- */
 
-#if 0
-static int memory = 0;
-#define ALLOC(size, comment)\
-do { memory += size; printf("%8d - %s\n", memory, comment); } while (0)
-#define RELEASE(size, comment)\
-do { memory -= size; printf("%8d - %s\n", memory, comment); } while (0)
-#else
-#define ALLOC(size, comment)
-#define RELEASE(size, comment)
-#endif
-
 /* compiler tweaks */
 #if defined(_MSC_VER)
 #define LOCAL(type) static __inline type __fastcall
@@ -301,7 +290,6 @@ create_new_element(PyObject* tag, PyObject* attrib)
 
     self->weakreflist = NULL;
 
-    ALLOC(sizeof(ElementObject), "create element");
     PyObject_GC_Track(self);
 
     if (attrib != NULL && !is_empty_dict(attrib)) {
@@ -676,7 +664,6 @@ element_dealloc(ElementObject* self)
     */
     element_gc_clear(self);
 
-    RELEASE(sizeof(ElementObject), "destroy element");
     Py_TYPE(self)->tp_free((PyObject *)self);
     Py_TRASHCAN_END
 }



More information about the Python-checkins mailing list