[Asterisk-code-review] utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN (...asterisk[16])
Sean Bright
asteriskteam at digium.com
Fri Oct 18 13:53:06 CDT 2019
Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/13081
Change subject: utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN
......................................................................
utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN
ASTERISK-28590 #close
Change-Id: I51abce00c04d0a06550bda5205580705185b9c1c
---
M include/asterisk/utils.h
1 file changed, 7 insertions(+), 2 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/81/13081/1
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index 4dc406d..2b332a5 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -423,8 +423,13 @@
* Thread management support (should be moved to lock.h or a different header)
*/
-#define AST_STACKSIZE (((sizeof(void *) * 8 * 8) - 16) * 1024)
-#define AST_STACKSIZE_LOW (((sizeof(void *) * 8 * 2) - 16) * 1024)
+#if defined(PTHREAD_STACK_MIN)
+# define AST_STACKSIZE MAX((((sizeof(void *) * 8 * 8) - 16) * 1024), PTHREAD_STACK_MIN)
+# define AST_STACKSIZE_LOW MAX((((sizeof(void *) * 8 * 2) - 16) * 1024), PTHREAD_STACK_MIN)
+#else
+# define AST_STACKSIZE (((sizeof(void *) * 8 * 8) - 16) * 1024)
+# define AST_STACKSIZE_LOW (((sizeof(void *) * 8 * 2) - 16) * 1024)
+#endif
int ast_background_stacksize(void);
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13081
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I51abce00c04d0a06550bda5205580705185b9c1c
Gerrit-Change-Number: 13081
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191018/0a2327ce/attachment.html>
More information about the asterisk-code-review
mailing list