[PATCH] Guard `CLOBBER_FREED_MEMORY` & `MEMORY_CONTEXT_CHECKING`

From: Samuel Marks <samuelmarks(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: [PATCH] Guard `CLOBBER_FREED_MEMORY` & `MEMORY_CONTEXT_CHECKING`
Date: 2024-08-23 21:09:22
Message-ID: CAMfPbcYq94UKjAr_R5YOPXWPNC9Sx9AOa6fS4Fio6tobEsmf5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From 73dbe66c0ed68ae588223639a2ba93f6a727b704 Mon Sep 17 00:00:00 2001
From: Samuel Marks <807580+SamuelMarks(at)users(dot)noreply(dot)github(dot)com>
Date: Fri, 23 Aug 2024 16:03:41 -0500
Subject: [PATCH] [src/include/pg_config_manual.h] Guard `CLOBBER_FREED_MEMORY`
& `MEMORY_CONTEXT_CHECKING`

---
src/include/pg_config_manual.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index e799c298..1f28d585 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -261,7 +261,7 @@
* facilitate catching bugs that refer to already-freed values.
* Right now, this gets defined automatically if --enable-cassert.
*/
-#ifdef USE_ASSERT_CHECKING
+#if defined(USE_ASSERT_CHECKING) && !defined(CLOBBER_FREED_MEMORY)
#define CLOBBER_FREED_MEMORY
#endif

@@ -270,7 +270,8 @@
* bytes than were allocated). Right now, this gets defined
* automatically if --enable-cassert or USE_VALGRIND.
*/
-#if defined(USE_ASSERT_CHECKING) || defined(USE_VALGRIND)
+#if (defined(USE_ASSERT_CHECKING) || defined(USE_VALGRIND)) && \
+ !defined(MEMORY_CONTEXT_CHECKING)
#define MEMORY_CONTEXT_CHECKING
#endif

--
2.43.0

Samuel Marks, PhD
https://linkedin.com/in/samuelmarks

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-08-23 21:11:30 Re: [PATCH] Guard `CLOBBER_FREED_MEMORY` & `MEMORY_CONTEXT_CHECKING`
Previous Message Joel Jacobson 2024-08-23 21:03:56 Re: Optimising numeric division