[Asterisk-code-review] utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN (...asterisk[16])

Kevin Harwell asteriskteam at digium.com
Mon Oct 21 13:51:30 CDT 2019


Kevin Harwell has submitted this change and it was merged. ( 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(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved; Approved for Submit



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-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191021/b0e30f46/attachment.html>


More information about the asterisk-code-review mailing list