diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-08 19:24:32 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-08 19:24:32 +0000 |
commit | 2f66127ba86be54c829b34bed11fcdd30c44f30d (patch) | |
tree | af72f1241b79b5cf1eea829db09e16a857ce559e /include/asterisk | |
parent | 5c1db5dddce0d0153f7c0d1f45a81f20b295c9ce (diff) |
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
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@199626 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/utils.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index f4790deca..253cfa91d 100644 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -262,12 +262,12 @@ static force_inline int inaddrcmp(const struct sockaddr_in *sin1, const struct s || (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); |