From cd11c3bfd77a288f79c03862bc99230b31d1be13 Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Tue, 18 Feb 2025 08:59:52 +0800 Subject: [PATCH 1/3] remove xmalloc() alias for debug_xmalloc() --- src/dmalloc.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/dmalloc.h b/src/dmalloc.h index 7a34dbe5c6e..5d55b159f9d 100644 --- a/src/dmalloc.h +++ b/src/dmalloc.h @@ -9,7 +9,6 @@ PMOD_EXPORT extern void *debug_xalloc(size_t); PMOD_EXPORT extern void debug_xfree(void *); -PMOD_EXPORT extern void *debug_xmalloc(size_t); PMOD_EXPORT extern void *debug_xcalloc(size_t,size_t); PMOD_EXPORT extern void *debug_xrealloc(void *,size_t); PMOD_EXPORT char *debug_xstrdup(const char *src); @@ -140,7 +139,6 @@ const char *dmalloc_find_name(void *p); #define xalloc(X) ((void *)debug_malloc_update_location((void *)debug_xalloc(X), DMALLOC_NAMED_LOCATION(" xalloc"))) #define xcalloc(N, S) ((void *)debug_malloc_update_location((void *)debug_xcalloc(N, S), DMALLOC_NAMED_LOCATION(" xcalloc"))) -#define xmalloc(X) ((void *)debug_malloc_update_location((void *)debug_xmalloc(X), DMALLOC_NAMED_LOCATION(" xmalloc"))) #define xrealloc(N, S) ((void *)debug_malloc_update_location((void *)debug_xrealloc(N, S), DMALLOC_NAMED_LOCATION(" xrealloc"))) #define xstrdup(X) ((void *)debug_malloc_update_location((void *)debug_xstrdup(X), DMALLOC_NAMED_LOCATION(" xstrdup"))) #define xfree(X) debug_xfree(debug_malloc_update_location((X), DMALLOC_NAMED_LOCATION(" free"))) @@ -230,10 +228,8 @@ PMOD_EXPORT struct mallinfo dlmallinfo(void); #define xstrdup debug_xstrdup #if defined(DYNAMIC_MODULE) && defined(__NT__) && !defined(USE_DLL) -#define xmalloc debug_xmalloc #define xfree debug_xfree #else -#define xmalloc malloc #define xfree free #endif /* defined(DYNAMIC_MODULE) && defined(__NT__) && !defined(USE_DLL) */ From ed4bf251eab7d5a91928aedd7fa2fa47241d43b0 Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Tue, 18 Feb 2025 09:01:23 +0800 Subject: [PATCH 2/3] remove debug_xmalloc() declaration --- src/pike_memory.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pike_memory.h b/src/pike_memory.h index 0859cce73dc..0a4a727a701 100644 --- a/src/pike_memory.h +++ b/src/pike_memory.h @@ -238,7 +238,6 @@ PMOD_EXPORT size_t hashmem(const void *, size_t len, size_t mlen) ATTRIBUTE((pur #define MALLOC_FUNCTION ATTRIBUTE((malloc)) PIKE_WARN_UNUSED_RESULT_ATTRIBUTE PMOD_EXPORT void *debug_xalloc(size_t size) MALLOC_FUNCTION; -PMOD_EXPORT void *debug_xmalloc(size_t s) MALLOC_FUNCTION; PMOD_EXPORT void debug_xfree(void *mem); PMOD_EXPORT void *debug_xrealloc(void *m, size_t s) MALLOC_FUNCTION; PMOD_EXPORT void *debug_xcalloc(size_t n, size_t s) MALLOC_FUNCTION; From 52110a58fa9dad35f192b70e1fbb7029b53364a2 Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Tue, 18 Feb 2025 09:03:10 +0800 Subject: [PATCH 3/3] remove unused debug_xmalloc() --- src/pike_memory.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/pike_memory.c b/src/pike_memory.c index 3571c60824a..307bb08eefe 100644 --- a/src/pike_memory.c +++ b/src/pike_memory.c @@ -511,11 +511,6 @@ PMOD_EXPORT void debug_xfree(void *mem) free(mem); } -PMOD_EXPORT void *debug_xmalloc(size_t s) -{ - return malloc(s); -} - PMOD_EXPORT void *debug_xrealloc(void *m, size_t s) { void *ret = realloc(m,s);