Date: Wed, 07 Aug 2019 01:59:52 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 239672] gcov: Optimize list traverse by using LIST_FOREACH_SAFE Message-ID: <bug-239672-227-QzBcH7sNHk@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-239672-227@https.bugs.freebsd.org/bugzilla/> References: <bug-239672-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D239672 Conrad Meyer <cem@freebsd.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cem@freebsd.org --- Comment #1 from Conrad Meyer <cem@freebsd.org> --- This change is not correct. Nodes are actually in a tree topology and remove_node() will release parent nodes as it goes, potentially invalidating the traverse (even with FOREACH_SAFE). The code could be refactored to mark removed nodes as a first pass, and then remove them in a second pass (with plain TAILQ_FOREACH_SAFE). This alterna= tive would avoid wasted work for nodes that are never removed (which is probably= the goal of the proposed change), but not break the algorithm. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-239672-227-QzBcH7sNHk>