texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Homogenize the reference to the NOTE in build_per


From: Patrice Dumas
Subject: branch master updated: Homogenize the reference to the NOTE in build_perl_info.c
Date: Sun, 25 Feb 2024 19:10:33 -0500

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

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new cf529603a4 Homogenize the reference to the NOTE in build_perl_info.c
cf529603a4 is described below

commit cf529603a42d86ec44f3893d95f900d3011a4328
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Feb 26 01:10:30 2024 +0100

    Homogenize the reference to the NOTE in build_perl_info.c
---
 ChangeLog                                                 |  4 ++++
 tp/Texinfo/XS/convert/ConvertXS.xs                        |  3 +++
 tp/Texinfo/XS/convert/build_html_perl_state.c             | 11 ++---------
 tp/Texinfo/XS/convert/call_html_perl_function.c           |  4 ++--
 tp/Texinfo/XS/convert/get_html_perl_info.c                |  5 +++--
 tp/Texinfo/XS/main/DocumentXS.xs                          |  3 +++
 tp/Texinfo/XS/main/IndicesXS.xs                           |  3 +++
 tp/Texinfo/XS/main/api_to_perl.c                          |  3 +++
 tp/Texinfo/XS/main/build_perl_info.c                      |  8 +++-----
 tp/Texinfo/XS/parsetexi/Parsetexi.xs                      |  3 +++
 tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs |  3 +++
 11 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a1fe0b38c9..226185baac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-02-25  Patrice Dumas  <pertusus@free.fr>
+
+       Homogenize the reference to the NOTE in build_perl_info.c
+
 2024-02-25  Patrice Dumas  <pertusus@free.fr>
 
        Add wrappers around functions to avoid mixing Perl and non-Perl
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs 
b/tp/Texinfo/XS/convert/ConvertXS.xs
index aa9b47b239..bbb35c7880 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -47,6 +47,9 @@
 #include "convert_html.h"
 #include "get_html_perl_info.h"
 
+ /* See the NOTE in build_perl_info.c on use of functions related to
+    memory allocation */
+
 MODULE = Texinfo::Convert::ConvertXS   PACKAGE = Texinfo::Convert::ConvertXS
 
 # there is always a check on prototypes in XSLoader.  So it is simpler if
diff --git a/tp/Texinfo/XS/convert/build_html_perl_state.c 
b/tp/Texinfo/XS/convert/build_html_perl_state.c
index df732a7dfd..d4cdf39c8e 100644
--- a/tp/Texinfo/XS/convert/build_html_perl_state.c
+++ b/tp/Texinfo/XS/convert/build_html_perl_state.c
@@ -49,15 +49,8 @@
 
 #define LOCALEDIR DATADIR "/locale"
 
-  /* NOTE: Do not call 'malloc' or 'free' in any function called in this file.
-     Since this file (build_html_perl_state.c) includes the Perl headers,
-     we get the Perl redefinitions, which we do not want, as we don't use
-     them throughout the rest of the program. */
-
-  /* Can't use asprintf here, because it might come from Gnulib, and
-     will then use malloc that is different from Perl's malloc, whereas
-     free below is redirected to Perl's implementation.  This could
-     cause crashes if the two malloc/free implementations were different.  */
+ /* See the NOTE in build_perl_info.c on use of functions related to
+    memory allocation */
 
 #define STORE(key, sv) hv_store (html_target_hv, key, strlen (key), sv, 0)
 HV *
diff --git a/tp/Texinfo/XS/convert/call_html_perl_function.c 
b/tp/Texinfo/XS/convert/call_html_perl_function.c
index 54ad4bcbf1..af91184285 100644
--- a/tp/Texinfo/XS/convert/call_html_perl_function.c
+++ b/tp/Texinfo/XS/convert/call_html_perl_function.c
@@ -44,8 +44,8 @@
 #include "build_html_perl_state.h"
 #include "call_html_perl_function.h"
 
- /* TODO the NOTE in build_perl_info.c about not using malloc/free should
-    be relevant for this file */
+ /* See the NOTE in build_perl_info.c on use of functions related to
+    memory allocation */
 
 /* NOTE newSVpv_utf8 is used for file names because extensions may be supplied
    by the user, the base file name may be ASCII, the extension may not.  Also,
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.c 
b/tp/Texinfo/XS/convert/get_html_perl_info.c
index 1e372de736..74a8d0a2ae 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.c
@@ -34,6 +34,7 @@
 
 #include "command_ids.h"
 #include "converter_types.h"
+/* also for non_perl_* */
 #include "utils.h"
 #include "builtin_commands.h"
 #include "debug.h"
@@ -46,8 +47,8 @@
 #include "build_perl_info.h"
 #include "get_html_perl_info.h"
 
- /* TODO the NOTE in build_perl_info.c about not using malloc/free should
-    be relevant for this file */
+ /* See the NOTE in build_perl_info.c on use of functions related to
+    memory allocation */
 
 /* Following is HTML specific */
 static SV **
diff --git a/tp/Texinfo/XS/main/DocumentXS.xs b/tp/Texinfo/XS/main/DocumentXS.xs
index 0a846bd9be..28c7694b58 100644
--- a/tp/Texinfo/XS/main/DocumentXS.xs
+++ b/tp/Texinfo/XS/main/DocumentXS.xs
@@ -36,6 +36,9 @@
 #include "get_perl_info.h"
 #include "build_perl_info.h"
 
+ /* See the NOTE in build_perl_info.c on use of functions related to
+    memory allocation */
+
 
 MODULE = Texinfo::DocumentXS           PACKAGE = Texinfo::DocumentXS
 
diff --git a/tp/Texinfo/XS/main/IndicesXS.xs b/tp/Texinfo/XS/main/IndicesXS.xs
index 1c2ce5c470..c34ef0ac5f 100644
--- a/tp/Texinfo/XS/main/IndicesXS.xs
+++ b/tp/Texinfo/XS/main/IndicesXS.xs
@@ -38,6 +38,9 @@
 /* for newSVpv_utf8 */
 #include "build_perl_info.h"
 
+ /* See the NOTE in build_perl_info.c on use of functions related to
+    memory allocation */
+
 MODULE = Texinfo::IndicesXS    PACKAGE = Texinfo::IndicesXS
 
 PROTOTYPES: ENABLE
diff --git a/tp/Texinfo/XS/main/api_to_perl.c b/tp/Texinfo/XS/main/api_to_perl.c
index 0eee28c0c6..85a120fcd2 100644
--- a/tp/Texinfo/XS/main/api_to_perl.c
+++ b/tp/Texinfo/XS/main/api_to_perl.c
@@ -37,6 +37,9 @@
 /* non_perl_* */
 #include "utils.h"
 
+ /* See the NOTE in build_perl_info.c on use of functions related to
+    memory allocation */
+
 /* to be called when a tree element is destroyed, to remove the reference
    of the association with the C tree */
 void
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index 04e56bdb2e..10b27982ec 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -68,14 +68,12 @@
       be used to allocate or free to match with the functions used to
       free or allocate in files using Gnulib definitions.
 
-      TODO say something about wrappers.
-
       To be sure to use Perl defined functions, wrappers
       can be used, from build_perl_info.h:
-       perl_only_free, perl_only_strdup, perl_only_strndup.
-
+       perl_only_free, perl_only_strdup, perl_only_strndup, perl_only_malloc,
+       perl_only_xvasprintf, perl_only_xasprintf.
 
-      To be sure to use non Perl defined functions, wrappers
+      To be sure to use non Perl defined functions, constructors and wrappers
       can be used, from utils.h:
        non_perl_free, non_perl_strdup, non_perl_strndup.
     */
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.xs 
b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
index 96aa0f5899..340dcd511c 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.xs
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
@@ -35,6 +35,9 @@
 /* for clear_document_errors */
 #include "document.h"
 
+ /* See the NOTE in build_perl_info.c on use of functions related to
+    memory allocation */
+
 MODULE = Texinfo::Parser       PACKAGE = Texinfo::Parser
 
 PROTOTYPES: ENABLE
diff --git a/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs 
b/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
index c0c2b3d640..8d24f8cef0 100644
--- a/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
+++ b/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
@@ -41,6 +41,9 @@
 #include "get_perl_info.h"
 #include "build_perl_info.h"
 
+ /* See the NOTE in build_perl_info.c on use of functions related to
+    memory allocation */
+
 MODULE = Texinfo::StructTransfXS       PACKAGE = Texinfo::StructTransfXS
 
 PROTOTYPES: ENABLE



reply via email to

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