Index: generic/tclAlloc.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclAlloc.c,v
retrieving revision 1.16
diff -u -r1.16 tclAlloc.c
--- generic/tclAlloc.c	23 Apr 2002 17:03:34 -0000	1.16
+++ generic/tclAlloc.c	26 Oct 2004 19:30:43 -0000
@@ -23,7 +23,7 @@
  * that has significantly reduced lock contention.
  */
 
-#if !defined(TCL_THREADS) || !defined(USE_THREAD_ALLOC)
+#if !defined(TCL_THREADS) || !defined(USE_THREAD_ALLOC) || defined(TCL_MEM_DEBUG)
 
 #include "tclInt.h"
 #include "tclPort.h"
Index: generic/tclThreadAlloc.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclThreadAlloc.c,v
retrieving revision 1.4.2.4
diff -u -r1.4.2.4 tclThreadAlloc.c
--- generic/tclThreadAlloc.c	25 Jul 2004 21:38:09 -0000	1.4.2.4
+++ generic/tclThreadAlloc.c	26 Oct 2004 19:30:43 -0000
@@ -16,7 +16,7 @@
 
 #include "tclInt.h"
 
-#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
+#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) && !defined(TCL_MEM_DEBUG)
 
 #ifdef WIN32
 #include "tclWinInt.h"
Index: unix/tclUnixThrd.c
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/tclUnixThrd.c,v
retrieving revision 1.23.2.8
diff -u -r1.23.2.8 tclUnixThrd.c
--- unix/tclUnixThrd.c	10 Aug 2004 19:35:47 -0000	1.23.2.8
+++ unix/tclUnixThrd.c	26 Oct 2004 19:30:44 -0000
@@ -883,7 +883,7 @@
 #endif
 }
 
-#ifdef TCL_THREADS
+#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) && !defined(TCL_MEM_DEBUG)
 /*
  * Additions by AOL for specialized thread memory allocator.
  */
Index: win/tclWinThrd.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinThrd.c,v
retrieving revision 1.24.2.8
diff -u -r1.24.2.8 tclWinThrd.c
--- win/tclWinThrd.c	21 Jul 2004 01:30:58 -0000	1.24.2.8
+++ win/tclWinThrd.c	26 Oct 2004 19:30:44 -0000
@@ -680,7 +680,7 @@
     DWORD *indexPtr;
     BOOL success;
 
-#ifdef USE_THREAD_ALLOC
+#if defined(USE_THREAD_ALLOC) && !defined(TCL_MEM_DEBUG)
     TclWinFreeAllocCache();
 #endif
     if (*keyPtr != NULL) {
@@ -1037,7 +1037,8 @@
 /*
  * Additions by AOL for specialized thread memory allocator.
  */
-#ifdef USE_THREAD_ALLOC
+
+#if defined(USE_THREAD_ALLOC) && !defined(TCL_MEM_DEBUG)
 static int once;
 static DWORD key;
 
