summaryrefslogtreecommitdiff
path: root/src/include/pg_config_manual.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-04-11 22:54:23 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-04-11 22:54:23 +0000
commit65c3d05e18e7c530ef671a956b3325f016659baa (patch)
tree8967506dcf48c99fcd18505c3b9ffcf4abbc336d /src/include/pg_config_manual.h
parentc846f7ca8a700f2f5418820a224cf59574ca4f04 (diff)
downloadpostgresql-65c3d05e18e7c530ef671a956b3325f016659baa.tar.gz
Add some debug support code to try to catch future mistakes in the area of
input functions that include garbage bytes in their results. Provide a compile-time option RANDOMIZE_ALLOCATED_MEMORY to make palloc fill returned blocks with variable contents. This option also makes the parser perform conversions of literal constants twice and compare the results, emitting a WARNING if they don't match. (This is the code I used to catch the input function bugs fixed in the previous commit.) For the moment, I've set it to be activated automatically by --enable-cassert.
Diffstat (limited to 'src/include/pg_config_manual.h')
-rw-r--r--src/include/pg_config_manual.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index 5eead55481..6d7ae4ed57 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -6,7 +6,7 @@
* for developers. If you edit any of these, be sure to do a *full*
* rebuild (and an initdb if noted).
*
- * $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.30 2008/03/27 03:57:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.31 2008/04/11 22:54:23 tgl Exp $
*------------------------------------------------------------------------
*/
@@ -215,10 +215,18 @@
*/
/*
+ * Define this to cause palloc()'d memory to be filled with random data, to
+ * facilitate catching code that depends on the contents of uninitialized
+ * memory. Right now, this gets defined automatically if --enable-cassert.
+ */
+#ifdef USE_ASSERT_CHECKING
+#define RANDOMIZE_ALLOCATED_MEMORY
+#endif
+
+/*
* Define this to cause pfree()'d memory to be cleared immediately, to
- * facilitate catching bugs that refer to already-freed values. XXX
- * Right now, this gets defined automatically if --enable-cassert. In
- * the long term it probably doesn't need to be on by default.
+ * facilitate catching bugs that refer to already-freed values.
+ * Right now, this gets defined automatically if --enable-cassert.
*/
#ifdef USE_ASSERT_CHECKING
#define CLOBBER_FREED_MEMORY
@@ -227,8 +235,7 @@
/*
* Define this to check memory allocation errors (scribbling on more
* bytes than were allocated). Right now, this gets defined
- * automatically if --enable-cassert. In the long term it probably
- * doesn't need to be on by default.
+ * automatically if --enable-cassert.
*/
#ifdef USE_ASSERT_CHECKING
#define MEMORY_CONTEXT_CHECKING