File readline-6.2-xmalloc.dif of Package readline
---
xfree.c | 3 +++
xmalloc.c | 5 +++++
xmalloc.h | 9 +++++++++
3 files changed, 17 insertions(+)
--- xfree.c
+++ xfree.c 2025-01-31 12:02:53.116122738 +0000
@@ -47,3 +47,6 @@ xfree (PTR_T string)
if (string)
free (string);
}
+
+#undef xfree
+extern void xfree PARAMS((void *)) __attribute__ ((weak, alias ("_rl_xfree")));
--- xmalloc.c
+++ xmalloc.c 2025-01-31 12:02:53.116122738 +0000
@@ -73,3 +73,8 @@ xrealloc (PTR_T pointer, size_t bytes)
memory_error_and_abort ("xrealloc");
return (temp);
}
+
+#undef xmalloc
+#undef xrealloc
+extern PTR_T xmalloc PARAMS((size_t)) __attribute__ ((weak, alias ("_rl_xmalloc")));
+extern PTR_T xrealloc PARAMS((void *, size_t)) __attribute__ ((weak, alias ("_rl_xrealloc")));
--- xmalloc.h
+++ xmalloc.h 2025-01-31 12:03:55.810973202 +0000
@@ -32,6 +32,15 @@
# define PTR_T void *
#endif /* !PTR_T */
+#undef xmalloc
+#undef xrealloc
+#undef xfree
+
+#define xmalloc _rl_xmalloc
+#define xrealloc _rl_xrealloc
+#define xfree _rl_xfree
+
+
extern PTR_T xmalloc (size_t);
extern PTR_T xrealloc (void *, size_t);
extern void xfree (void *);