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/utils.c (non_perl_malloc): a


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/utils.c (non_perl_malloc): add.
Date: Tue, 11 Jun 2024 09:56:22 -0400

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 463623576d * tp/Texinfo/XS/main/utils.c (non_perl_malloc): add.
463623576d is described below

commit 463623576d347507284c70a15613d91d75e4c1aa
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Jun 11 15:56:15 2024 +0200

    * tp/Texinfo/XS/main/utils.c (non_perl_malloc): add.
    
    * tp/Texinfo/XS/main/call_perl_function.c (call_collator_getSortKey):
    use non_perl_malloc instead of malloc.
---
 ChangeLog                               | 7 +++++++
 tp/Texinfo/XS/main/build_perl_info.c    | 2 +-
 tp/Texinfo/XS/main/call_perl_function.c | 4 ++--
 tp/Texinfo/XS/main/utils.c              | 6 ++++++
 tp/Texinfo/XS/main/utils.h              | 1 +
 5 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 490ddd421d..7035654d57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-06-11  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/utils.c (non_perl_malloc): add.
+
+       * tp/Texinfo/XS/main/call_perl_function.c (call_collator_getSortKey):
+       use non_perl_malloc instead of malloc.
+
 2024-06-11  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/convert/call_html_perl_function.c
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index cd1c8d513e..b34b6e76d2 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -76,7 +76,7 @@
 
       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,
+       non_perl_free, non_perl_malloc, non_perl_strdup, non_perl_strndup,
        non_perl_xvasprintf, non_perl_xasprintf.
     */
 
diff --git a/tp/Texinfo/XS/main/call_perl_function.c 
b/tp/Texinfo/XS/main/call_perl_function.c
index e9e22ff8c3..f98f1da031 100644
--- a/tp/Texinfo/XS/main/call_perl_function.c
+++ b/tp/Texinfo/XS/main/call_perl_function.c
@@ -203,7 +203,7 @@ call_collator_getSortKey (const void *collator_sv, const 
char *string)
 
   dTHX;
 
-  result = malloc (sizeof (BYTES_STRING));
+  result = (BYTES_STRING *) non_perl_malloc (sizeof (BYTES_STRING));
   dSP;
 
   ENTER;
@@ -229,7 +229,7 @@ call_collator_getSortKey (const void *collator_sv, const 
char *string)
   result_ret = (unsigned char *)SvPVbyte (result_sv, len);
   result->len = (size_t) len;
   result->bytes = (unsigned char *)
-    malloc (sizeof (unsigned char) * len);
+    non_perl_malloc (sizeof (unsigned char) * len);
   memcpy (result->bytes, result_ret, result->len);
 
   PUTBACK;
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index 358f892375..8a9a95b93e 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -146,6 +146,12 @@ non_perl_free (void *ptr)
   free (ptr);
 }
 
+void *
+non_perl_malloc (size_t size)
+{
+  return malloc (size);
+}
+
 char *
 non_perl_strdup (const char *s)
 {
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index b6102a2341..1afc279fa9 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -155,6 +155,7 @@ typedef struct TARGET_DIRECTORY_FILENAME {
 } TARGET_DIRECTORY_FILENAME;
 
 void non_perl_free (void *ptr);
+void *non_perl_malloc (size_t size);
 char *non_perl_strdup (const char *s);
 char *non_perl_strndup (const char *s, size_t n);
 int non_perl_xvasprintf (char **ptr, const char *template, va_list ap);



reply via email to

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