[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] malloc, realloc: fix recently-introduced #undef typos
From: |
Paul Eggert |
Subject: |
[PATCH] malloc, realloc: fix recently-introduced #undef typos |
Date: |
Fri, 16 Apr 2021 17:07:54 -0700 |
* lib/malloc.c (malloc):
* lib/realloc.c (malloc, realloc): #undef before using.
---
ChangeLog | 6 ++++++
lib/malloc.c | 3 +++
lib/realloc.c | 4 ++++
3 files changed, 13 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 7c519ee44..3207c22cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-04-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ malloc, realloc: fix recently-introduced #undef typos
+ * lib/malloc.c (malloc):
+ * lib/realloc.c (malloc, realloc): #undef before using.
+
2021-04-14 Bruno Haible <bruno@clisp.org>
hamt tests: Fix link error.
diff --git a/lib/malloc.c b/lib/malloc.c
index 7b5ae9589..272b8b9f4 100644
--- a/lib/malloc.c
+++ b/lib/malloc.c
@@ -33,6 +33,9 @@
# include <errno.h>
+/* Call the system's malloc below. */
+# undef malloc
+
/* Allocate an N-byte block of memory from the heap.
If N is zero, allocate a 1-byte block. */
diff --git a/lib/realloc.c b/lib/realloc.c
index 3bf1bea2d..c3e3cdfc5 100644
--- a/lib/realloc.c
+++ b/lib/realloc.c
@@ -40,6 +40,10 @@
# include <errno.h>
+/* Call the system's malloc and realloc below. */
+# undef malloc
+# undef realloc
+
/* Change the size of an allocated block of memory P to N bytes,
with error checking. If N is zero, change it to 1. If P is NULL,
use malloc. */
--
2.30.2
- [PATCH] malloc, realloc: fix recently-introduced #undef typos,
Paul Eggert <=