texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/main/build_perl_info.c: update co


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/build_perl_info.c: update comment on Perl/C library plus Gnulib mixing to make clearer that there would be incompatibilities between Perl and C library memory management functions even without Gnulib.
Date: Sun, 08 Dec 2024 15:31:03 -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 0f832a925e * tp/Texinfo/XS/main/build_perl_info.c: update comment on 
Perl/C library plus Gnulib mixing to make clearer that there would be 
incompatibilities between Perl and C library memory management functions even 
without Gnulib.
0f832a925e is described below

commit 0f832a925edcb4299d66bbcc648a996420296b02
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Dec 8 21:30:58 2024 +0100

    * tp/Texinfo/XS/main/build_perl_info.c: update comment on Perl/C
    library plus Gnulib mixing to make clearer that there would be
    incompatibilities between Perl and C library memory management
    functions even without Gnulib.
---
 ChangeLog                            |  7 +++++++
 tp/Texinfo/XS/main/build_perl_info.c | 22 ++++++++++++----------
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d8de3a4fa0..4081681734 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-12-08  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/build_perl_info.c: update comment on Perl/C
+       library plus Gnulib mixing to make clearer that there would be
+       incompatibilities between Perl and C library memory management
+       functions even without Gnulib.
+
 2024-12-08  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/Makefile.am (C_libtexinfo_sources),
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index 1f71646915..01ce2a4f9f 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -87,18 +87,19 @@
 #include "build_perl_info.h"
 
   /* NOTE This file includes the Perl headers, therefore we get the Perl
-     redefinitions of functions related to memory allocation, such as
-     'free' or 'malloc'.  In other files, the Gnulib redefinition of
-     those functions are used.  It is wrong to mix functions from Perl
-     and Gnulib.  If memory is allocated with Gnulib defined malloc,
-     and then freed with Perl defined free (or vice versa), then an
-     error can occur like "Free to wrong pool".
+     redefinitions of functions, in particular for functions related to
+     memory allocation, such as 'free' or 'malloc'.  In other files, the
+     C library or Gnulib redefinition of those functions are used.  It is
+     wrong to mix functions from Perl and C library plus Gnulib.  If memory
+     is allocated with C library malloc, and then freed with Perl defined
+     free (or vice versa), then an error can occur like "Free to wrong pool".
     https://lists.gnu.org/archive/html/bug-texinfo/2016-01/msg00016.html
    */
 
-   /* Functions defined in files with Gnulib definition should therefore
-      be used to allocate or free to match with the functions used to
-      free or allocate in other files using Gnulib definitions.
+   /* Functions defined in files with C library plus Gnulib definition should
+      therefore be used to allocate or free to match with the functions
+      used to free or allocate in other files using C library plus Gnulib
+      definitions.
 
       To be sure to use non Perl defined functions, constructors and wrappers
       must be used, from xs_utils.h:
@@ -107,7 +108,8 @@
 
       This is often needed, when memory is allocated or free'd in
       'pure' C code (code that does not include Perl headers), as it is
-      safer to assume that Gnulib is always used in 'pure' C code.
+      safer to assume that C library or Gnulib function definitions are
+      always used in 'pure' C code.
 
       To be sure to use Perl defined functions in files that include
       both Gnulib and Perl headers, wrappers can be used, from



reply via email to

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