texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/parsetexi/api.c (reset_parser_exc


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf): Always call destroy_element_and_children.
Date: Fri, 14 Apr 2023 07:01:24 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new a92194f1bb * tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf): 
Always call destroy_element_and_children.
a92194f1bb is described below

commit a92194f1bba07aec2c9d607d3f5ccff1ecbe1b62
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Apr 14 12:01:12 2023 +0100

    * tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf):
    Always call destroy_element_and_children.
---
 ChangeLog                     |  5 +++++
 tp/Texinfo/XS/parsetexi/api.c | 17 ++---------------
 2 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 96787dc940..8564d87c1c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-04-14  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf):
+       Always call destroy_element_and_children.
+
 2023-04-14  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/XS/parsetexi/tree.c (reset_obstacks):
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 9357e68d60..a6a5db32ad 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -113,29 +113,16 @@ reset_floats ()
   floats_number = 0;
 }
 
-ELEMENT *Root;
-
-/* Array to keep old values of Root.  This is a time efficiency to avoid
-   calling destroy_element_and_children.  It is likely the first value
-   of Root is the main parse tree representing the whole document.
-   We keep the references to avoid the appearance of a memory leak. */
-#define MAX_OLD_ROOTS 5
-static ELEMENT *old_roots[MAX_OLD_ROOTS];
-static int n_old_roots = 0;
-
-
 void
 reset_parser_except_conf (void)
 {
   /* do before destroying tree because index entries refer to in-tree
      elements. */
   wipe_indices ();
+
   if (Root)
     {
-      if (n_old_roots == MAX_OLD_ROOTS)
-        destroy_element_and_children (Root);
-      else
-        old_roots[n_old_roots++] = Root;
+      destroy_element_and_children (Root);
       Root = 0;
     }
   wipe_user_commands ();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]