summaryrefslogtreecommitdiffstats
path: root/generic/tclAlloc.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-11 20:34:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-11 20:34:07 (GMT)
commite975dd1380b75e0736e5737ecf73efe9129361bc (patch)
tree020db13467ebfca10c4f307cd55644e9f167a694 /generic/tclAlloc.c
parent8c9ff9ac6ac043b04ecfe5593ba048130c61bcbd (diff)
parent89c110fbb0e12918bbcb59f9d1a8c5503a5fa019 (diff)
downloadtcl-e975dd1380b75e0736e5737ecf73efe9129361bc.zip
tcl-e975dd1380b75e0736e5737ecf73efe9129361bc.tar.gz
tcl-e975dd1380b75e0736e5737ecf73efe9129361bc.tar.bz2
[Bug 3448512]: clock scan "1958-01-01" fails only in debug compilation
Diffstat (limited to 'generic/tclAlloc.c')
-rw-r--r--generic/tclAlloc.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c
index 6fff92b..ae61e85 100644
--- a/generic/tclAlloc.c
+++ b/generic/tclAlloc.c
@@ -26,12 +26,6 @@
#if USE_TCLALLOC
-#ifdef TCL_DEBUG
-# define DEBUG
-/* #define MSTATS */
-# define RCHECK
-#endif
-
/*
* We should really make use of AC_CHECK_TYPE(caddr_t) here, but it can wait
* until Tcl uses config.h properly.
@@ -60,7 +54,7 @@ union overhead {
unsigned char index; /* bucket # */
unsigned char unused; /* unused */
unsigned char magic1; /* other magic number */
-#ifdef RCHECK
+#ifndef NDEBUG
unsigned short rmagic; /* range magic number */
unsigned long size; /* actual block size */
unsigned short unused2; /* padding to 8-byte align */
@@ -77,7 +71,7 @@ union overhead {
#define MAGIC 0xef /* magic # on accounting info */
#define RMAGIC 0x5555 /* magic # on range info */
-#ifdef RCHECK
+#ifndef NDEBUG
#define RSLOP sizeof(unsigned short)
#else
#define RSLOP 0
@@ -142,7 +136,7 @@ static int allocInit = 0;
static unsigned int numMallocs[NBUCKETS+1];
#endif
-#if defined(DEBUG) || defined(RCHECK)
+#if !defined(NDEBUG)
#define ASSERT(p) if (!(p)) Tcl_Panic(# p)
#define RANGE_ASSERT(p) if (!(p)) Tcl_Panic(# p)
#else
@@ -299,7 +293,7 @@ TclpAlloc(
numMallocs[NBUCKETS]++;
#endif
-#ifdef RCHECK
+#ifndef NDEBUG
/*
* Record allocated size of block and bound space with magic numbers.
*/
@@ -357,7 +351,7 @@ TclpAlloc(
numMallocs[bucket]++;
#endif
-#ifdef RCHECK
+#ifndef NDEBUG
/*
* Record allocated size of block and bound space with magic numbers.
*/
@@ -577,7 +571,7 @@ TclpRealloc(
numMallocs[NBUCKETS]++;
#endif
-#ifdef RCHECK
+#ifndef NDEBUG
/*
* Record allocated size of block and update magic number bounds.
*/
@@ -619,7 +613,7 @@ TclpRealloc(
* Ok, we don't have to copy, it fits as-is
*/
-#ifdef RCHECK
+#ifndef NDEBUG
overPtr->realBlockSize = (numBytes + RSLOP - 1) & ~(RSLOP - 1);
BLOCK_END(overPtr) = RMAGIC;
#endif