]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
align mthread stacks on 16-byte boundaries 6946/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Sat, 8 Sep 2018 16:49:42 +0000 (18:49 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Sat, 8 Sep 2018 16:49:42 +0000 (18:49 +0200)
pdns/mtasker.hh

index 313d18f290930e963475bd8090d4ba2152f39b4f..87bc6723cff1dc760c513e880dd2b9f46499f027 100644 (file)
@@ -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