From aa1c91d98ee0e12d473c4ed6dbb00586e9fbf6b5 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Sat, 8 Sep 2018 18:49:42 +0200 Subject: [PATCH] align mthread stacks on 16-byte boundaries --- pdns/mtasker.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pdns/mtasker.hh b/pdns/mtasker.hh index 313d18f290..87bc6723cf 100644 --- a/pdns/mtasker.hh +++ b/pdns/mtasker.hh @@ -113,6 +113,9 @@ public: MTasker(size_t stacksize=16*8192) : d_tid(0), d_maxtid(0), d_stacksize(stacksize), d_waitstatus(Error) { initMainStackBounds(); + + // make sure our stack is 16-byte aligned to make all the architectures happy + d_stacksize = d_stacksize >> 4 << 4; } typedef void tfunc_t(void *); //!< type of the pointer that starts a thread -- 2.47.2