python-pyqt6-sip/sipMalloc-and-sipFree-are-now-implemented-using-PyMe.patch

37 lines
909 B
Diff

From 9c13eac1177f90a44f811f265ea8e4caa41879c9 Mon Sep 17 00:00:00 2001
From: Phil Thompson <phil@riverbankcomputing.com>
Date: Wed, 21 Jun 2023 14:30:26 +0200
Subject: [PATCH] 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().
---
sip_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sip_core.c b/sip_core.c
index f763090..a51513f 100644
--- a/sip_core.c
+++ b/sip_core.c
@@ -1886,7 +1886,7 @@ void *sip_api_malloc(size_t nbytes)
{
void *mem;
- if ((mem = PyMem_Malloc(nbytes)) == NULL)
+ if ((mem = PyMem_RawMalloc(nbytes)) == NULL)
PyErr_NoMemory();
return mem;
@@ -1898,7 +1898,7 @@ void *sip_api_malloc(size_t nbytes)
*/
void sip_api_free(void *mem)
{
- PyMem_Free(mem);
+ PyMem_RawFree(mem);
}
--
2.40.1