summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixInit.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-11-10 22:24:12 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-11-10 22:24:12 (GMT)
commit6e7b0d042d8e2395df7a6408768fde12c23abdae (patch)
tree566675aa0f9a8b20448e3bc3c1b1726ad3c82f0e /unix/tclUnixInit.c
parentdb8435f4f6d903ab177a991ed393676493928b77 (diff)
downloadtcl-6e7b0d042d8e2395df7a6408768fde12c23abdae.zip
tcl-6e7b0d042d8e2395df7a6408768fde12c23abdae.tar.gz
tcl-6e7b0d042d8e2395df7a6408768fde12c23abdae.tar.bz2
* generic/tclBasic.c:
* unix/configure.in: * unix/tclUnixInit.c: detect stack grwoth direction at compile time, only fall to runtime detection when crosscompiling.
Diffstat (limited to 'unix/tclUnixInit.c')
-rw-r--r--unix/tclUnixInit.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index e4ba0f2..9202c26 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -7,7 +7,7 @@
* Copyright (c) 1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tclUnixInit.c,v 1.77 2007/11/10 20:49:21 das Exp $
+ * RCS: @(#) $Id: tclUnixInit.c,v 1.78 2007/11/10 22:24:14 msofer Exp $
*/
#include "tclInt.h"
@@ -81,8 +81,14 @@ typedef struct ThreadSpecificData {
int *stackBound; /* The current stack boundary */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
+#ifdef TCL_CROSS_COMPILE
static int stackGrowsDown = -1;
static int StackGrowsDown(int *parent);
+#elif defined(TCL_STACK_GROWS_UP)
+static int stackGrowsDown = 0;
+#else
+static int stackGrowsDown = 1;
+#endif
#endif /* TCL_NO_STACK_CHECK */
#ifdef TCL_DEBUG_STACK_CHECK
@@ -1035,7 +1041,7 @@ TclpGetCStackParams(
/* Most variables are actually in a
* thread-specific data block to minimise the
* impact on the stack. */
-
+#ifdef TCL_CROSS_COMPILE
if (stackGrowsDown == -1) {
/*
* Not initialised!
@@ -1043,7 +1049,8 @@ TclpGetCStackParams(
stackGrowsDown = StackGrowsDown(&result);
}
-
+#endif
+
/*
* The first time through in a thread: record the "outermost" stack
* frame and inquire with the OS about the stack size.
@@ -1094,6 +1101,7 @@ TclpGetCStackParams(
return stackGrowsDown;
}
+#ifdef TCL_CROSS_COMPILE
int
StackGrowsDown(
int *parent)
@@ -1102,6 +1110,7 @@ StackGrowsDown(
return (&here < parent);
}
#endif
+#endif
/*