From 3faa694500b76066d4dcc0917f145042350d7910 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Tue, 29 Aug 2006 05:33:35 +0000 Subject: Fix for stack.test failures on FreeBSD --- ChangeLog | 6 ++++++ unix/tclUnixInit.c | 16 ++++------------ unix/tclUnixThrd.c | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05b1b5f..66d2f68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-08-29 Joe Mistachkin + + * unix/tclUnixInit.c: Fixed the issue (typo) that was causing + * unix/tclUnixThrd.c (TclpThreadGetStackSize): stack.test to + fail on FreeBSD (and possibly other Unix platforms). + 2006-08-29 Colin McCormack * generic/tclIOUtil.c: Added test for NULL return diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 4287927..6fe79d9 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.65 2006/08/18 07:45:32 das Exp $ + * RCS: @(#) $Id: tclUnixInit.c,v 1.66 2006/08/29 05:33:36 mistachkin Exp $ */ #include "tclInt.h" @@ -54,23 +54,15 @@ * Values used to compute how much space is really available for Tcl's use for * the stack. * - * NOTE: Now I have some idea why the maximum stack size must be divided by 64 - * on FreeBSD with threads enabled to get a reasonably correct value. - * * The getrlimit() function is documented to return the maximum stack size in - * bytes. However, with threads enabled, the pthread library does bad things - * to the stack size limits. First, the limits cannot be changed. Second, they - * appear to be reported incorrectly by a factor of about 64. + * bytes. However, with threads enabled, the pthread library on some platforms + * does bad things to the stack size limits. First, the limits cannot be + * changed. Second, they appear to be sometimes reported incorrectly. * * The defines below may need to be adjusted if more platforms have this * broken behavior with threads enabled. */ -#if defined(__FreeBSD__) -# define TCL_MAGIC_STACK_DIVISOR 64 -# define TCL_RESERVED_STACK_PAGES 3 -#endif - #ifndef TCL_MAGIC_STACK_DIVISOR #define TCL_MAGIC_STACK_DIVISOR 1 #endif diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index f8131c0..434cbed 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -215,7 +215,7 @@ TclpThreadExit( int TclpThreadGetStackSize(void) { -#if defined(HAVE_PTHREAD_SETSTACKSIZE) && defined(TclpPthreadGetAttrs) +#if defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && defined(TclpPthreadGetAttrs) pthread_attr_t threadAttr; /* This will hold the thread attributes for * the current thread. */ size_t stackSize; -- cgit v0.12