]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove an old, elementtree-specific leak detector (GH-31811)
authorOleg Iarygin <oleg@arhadthedev.net>
Fri, 11 Mar 2022 14:47:42 +0000 (17:47 +0300)
committerGitHub <noreply@github.com>
Fri, 11 Mar 2022 14:47:42 +0000 (09:47 -0500)
Modules/_elementtree.c

index f54c28447ca8fa37397dfd8aaa94a39eb3a85eea..1794124aa45add837e4167f1bcb73a4f89ed97c3 100644 (file)
 
 /* -------------------------------------------------------------------- */
 
-#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
 }