diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-04-11 19:19:55 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-04-11 19:19:55 (GMT) |
commit | f05db2499a1f26791588140d9c283f7ee8e7c23a (patch) | |
tree | d9f05afa9420890334339deb59874ee16d0dcc2e /generic/tclAlloc.c | |
parent | 35931d9a7cb0477591913a5a95bc958f75fbded8 (diff) | |
download | tcl-f05db2499a1f26791588140d9c283f7ee8e7c23a.zip tcl-f05db2499a1f26791588140d9c283f7ee8e7c23a.tar.gz tcl-f05db2499a1f26791588140d9c283f7ee8e7c23a.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.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c index 5022618..7b9c807 100644 --- a/generic/tclAlloc.c +++ b/generic/tclAlloc.c @@ -28,12 +28,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. @@ -71,7 +65,7 @@ union overhead { unsigned char ovu_index; /* bucket # */ unsigned char ovu_unused; /* unused */ unsigned char ovu_magic1; /* other magic number */ -#ifdef RCHECK +#ifndef NDEBUG unsigned short ovu_rmagic; /* range magic number */ unsigned long ovu_size; /* actual block size */ unsigned short ovu_unused2; /* padding to 8-byte align */ @@ -88,7 +82,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 @@ -148,7 +142,7 @@ static unsigned int nmalloc[NBUCKETS+1]; #include <stdio.h> #endif -#if defined(DEBUG) || defined(RCHECK) +#if !defined(NDEBUG) #define ASSERT(p) if (!(p)) panic(# p) #define RANGE_ASSERT(p) if (!(p)) panic(# p) #else @@ -304,7 +298,7 @@ TclpAlloc(nbytes) #ifdef MSTATS nmalloc[NBUCKETS]++; #endif -#ifdef RCHECK +#ifndef NDEBUG /* * Record allocated size of block and * bound space with magic numbers. @@ -355,7 +349,7 @@ TclpAlloc(nbytes) #ifdef MSTATS nmalloc[bucket]++; #endif -#ifdef RCHECK +#ifndef NDEBUG /* * Record allocated size of block and * bound space with magic numbers. @@ -567,7 +561,7 @@ TclpRealloc(cp, nbytes) #ifdef MSTATS nmalloc[NBUCKETS]++; #endif -#ifdef RCHECK +#ifndef NDEBUG /* * Record allocated size of block and update magic number bounds. */ @@ -606,7 +600,7 @@ TclpRealloc(cp, nbytes) /* * Ok, we don't have to copy, it fits as-is */ -#ifdef RCHECK +#ifndef NDEBUG op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); *(unsigned short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; #endif |