diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index cd1c7fa6b3bc1fb00c5818389eeffb78c1db9c22..8a37fca346b6524f144ba243314af37e999840e8 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -349,13 +349,13 @@ int ast_careful_fwrite(FILE *f, int fd, const char *s, size_t len, int timeoutms
 /*
  * Thread management support (should be moved to lock.h or a different header)
  */
- 
-#define AST_STACKSIZE 240 * 1024
+
+#define AST_STACKSIZE (((__WORDSIZE * 8) - 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);