Blob Blame History Raw

# HG changeset patch
# User Phil Thompson <phil@riverbankcomputing.com>
# Date 1686925181 -3600
# Node ID 312476401030130daed2eecfd1c93413f49e4458
# Parent  88452293f4e4cdc9d22cb5dfca02ba83216f662b
sipMalloc() and sipFree() are now implemented using PyMem_RawMalloc() and
PyMem_RawFree() so that they should be safe to call from functions registered
with Py_AtExit().

diff -r 88452293f4e4 -r 312476401030 sipbuild/module/source/12/siplib.c
--- a/siplib.c	Thu Jun 08 14:30:02 2023 +0100
+++ b/siplib.c	Fri Jun 16 15:19:41 2023 +0100
@@ -2147,7 +2147,7 @@
 {
     void *mem;
 
-    if ((mem = PyMem_Malloc(nbytes)) == NULL)
+    if ((mem = PyMem_RawMalloc(nbytes)) == NULL)
         PyErr_NoMemory();
 
     return mem;
@@ -2159,7 +2159,7 @@
  */
 void sip_api_free(void *mem)
 {
-    PyMem_Free(mem);
+    PyMem_RawFree(mem);
 }