From: Peter van Dijk Date: Sat, 8 Sep 2018 16:49:42 +0000 (+0200) Subject: align mthread stacks on 16-byte boundaries X-Git-Tag: dnsdist-1.3.3~100^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa1c91d98ee0e12d473c4ed6dbb00586e9fbf6b5;p=thirdparty%2Fpdns.git align mthread stacks on 16-byte boundaries --- 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