From: Paul Floyd Date: Sun, 5 Mar 2023 15:13:09 +0000 (+0100) Subject: Solaris: bump alignment to next power of two for aligned_alloc X-Git-Tag: VALGRIND_3_21_0~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ca2fa7b1f25681cdf25b1975cabd2d71abbcfa2;p=thirdparty%2Fvalgrind.git Solaris: bump alignment to next power of two for aligned_alloc I'm not changing the Valgrind allocator to fit Solaris, too bad. --- diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 09c1dccdb1..b00d33d497 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1990,6 +1990,8 @@ extern int *___errno (void) __attribute__((weak)); /* Round up to minimum alignment if necessary. */ \ if (alignment < VG_MIN_MALLOC_SZB) \ alignment = VG_MIN_MALLOC_SZB; \ + /* Solaris allows non-power of 2 alignment but not Valgrind. */ \ + while (0 != (alignment & (alignment - 1))) alignment++; \ \ mem = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, \ alignment, size ); \