From 6d9f6affb6f42a1962c806f314bdb656f0f61d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Valur=20J=C3=B3nsson?= Date: Mon, 28 Sep 2009 13:45:02 +0000 Subject: http://bugs.python.org/issue6836 Merging revisions 75103,75104 from trunk to py3k --- Include/objimpl.h | 7 +++++++ Include/pymem.h | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'Include') diff --git a/Include/objimpl.h b/Include/objimpl.h index 5a27382537..a9ac41cb46 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -108,6 +108,13 @@ PyAPI_FUNC(void) _PyObject_DebugFree(void *p); PyAPI_FUNC(void) _PyObject_DebugDumpAddress(const void *p); PyAPI_FUNC(void) _PyObject_DebugCheckAddress(const void *p); PyAPI_FUNC(void) _PyObject_DebugMallocStats(void); +PyAPI_FUNC(void *) _PyObject_DebugMallocApi(char api, size_t nbytes); +PyAPI_FUNC(void *) _PyObject_DebugReallocApi(char api, void *p, size_t nbytes); +PyAPI_FUNC(void) _PyObject_DebugFreeApi(char api, void *p); +PyAPI_FUNC(void) _PyObject_DebugCheckAddressApi(char api, const void *p); +PyAPI_FUNC(void *) _PyMem_DebugMalloc(size_t nbytes); +PyAPI_FUNC(void *) _PyMem_DebugRealloc(void *p, size_t nbytes); +PyAPI_FUNC(void) _PyMem_DebugFree(void *p); #define PyObject_MALLOC _PyObject_DebugMalloc #define PyObject_Malloc _PyObject_DebugMalloc #define PyObject_REALLOC _PyObject_DebugRealloc diff --git a/Include/pymem.h b/Include/pymem.h index 542aceef25..e2dfe0d3fc 100644 --- a/Include/pymem.h +++ b/Include/pymem.h @@ -59,9 +59,9 @@ PyAPI_FUNC(void) PyMem_Free(void *); /* Macros. */ #ifdef PYMALLOC_DEBUG /* Redirect all memory operations to Python's debugging allocator. */ -#define PyMem_MALLOC PyObject_MALLOC -#define PyMem_REALLOC PyObject_REALLOC -#define PyMem_FREE PyObject_FREE +#define PyMem_MALLOC _PyMem_DebugMalloc +#define PyMem_REALLOC _PyMem_DebugRealloc +#define PyMem_FREE _PyMem_DebugFree #else /* ! PYMALLOC_DEBUG */ -- cgit v1.2.1