[svn-commits] seanbright: branch 1.4 r199626 - /branches/1.4/include/asterisk/utils.h

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jun 8 14:24:45 CDT 2009


Author: seanbright
Date: Mon Jun  8 14:24:32 2009
New Revision: 199626

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199626
Log:
Increase the size of our thread stack on 64 bit processors.

We were setting the stack size for each thread to 240KB regardless of
architecture, which meant that in some scenarios we actually had less available
stack space on 64 bit processors (pointers use 8 bytes instead of 4).  So now we
calculate the stack size we reserve based on the platform's __WORDSIZE, which
gives us:

     32 bit -> 240KB
     64 bit -> 496KB
    128 bit -> 1008KB (that's right, we're ready for 128 bit processors)

Patch typed by me but written by several members of #asterisk-dev, including
Kevin, Tilghman, and Qwell.

(closes issue #14932)
Reported by: jpiszcz
Patches:
      06052009_issue14932.patch uploaded by seanbright (license 71)
Tested by: seanbright

Modified:
    branches/1.4/include/asterisk/utils.h

Modified: branches/1.4/include/asterisk/utils.h
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/include/asterisk/utils.h?view=diff&rev=199626&r1=199625&r2=199626
==============================================================================
--- branches/1.4/include/asterisk/utils.h (original)
+++ branches/1.4/include/asterisk/utils.h Mon Jun  8 14:24:32 2009
@@ -262,12 +262,12 @@
 		|| (sin1->sin_port != sin2->sin_port));
 }
 
-#define AST_STACKSIZE 240 * 1024
+#define AST_STACKSIZE (((__WORDSIZE * 6) - 16) * 1024)
 
 #if defined(LOW_MEMORY)
-#define AST_BACKGROUND_STACKSIZE 48 * 1024
+#define AST_BACKGROUND_STACKSIZE (((__WORDSIZE * 2) - 16) * 1024)
 #else
-#define AST_BACKGROUND_STACKSIZE 240 * 1024
+#define AST_BACKGROUND_STACKSIZE AST_STACKSIZE
 #endif
 
 void ast_register_thread(char *name);




More information about the svn-commits mailing list