Browse Source
Apply patch suggested in issue https://github.com/termux/termux-packages/issues/5291.master
Leonid Pliushch
5 years ago
2 changed files with 26 additions and 1 deletions
@ -0,0 +1,25 @@ |
|||
diff -ur wrk-4.1.0-orig/src/zmalloc.c wrk-4.1.0/src/zmalloc.c
|
|||
--- wrk-4.1.0-orig/src/zmalloc.c 2020-05-07 01:47:50.562052028 +0000
|
|||
+++ wrk-4.1.0/src/zmalloc.c 2020-05-07 01:48:12.281671231 +0000
|
|||
@@ -45,13 +45,19 @@
|
|||
#include "zmalloc.h" |
|||
#include "atomicvar.h" |
|||
|
|||
+#ifdef _LP64
|
|||
+#define ALIGMENT (16)
|
|||
+#else
|
|||
+#define ALIGMENT (8)
|
|||
+#endif
|
|||
+#define ROUND_UP(n,r) (((n + r - 1) / r ) * r)
|
|||
#ifdef HAVE_MALLOC_SIZE |
|||
#define PREFIX_SIZE (0) |
|||
#else |
|||
#if defined(__sun) || defined(__sparc) || defined(__sparc__) |
|||
-#define PREFIX_SIZE (sizeof(long long))
|
|||
+#define PREFIX_SIZE (ROUND_UP(sizeof(long long), ALIGMENT))
|
|||
#else |
|||
-#define PREFIX_SIZE (sizeof(size_t))
|
|||
+#define PREFIX_SIZE (ROUND_UP(sizeof(size_t), ALIGMENT))
|
|||
#endif |
|||
#endif |
|||
|
Loading…
Reference in new issue