|
From: Paul F. <pa...@so...> - 2023-03-05 15:17:27
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4ca2fa7b1f25681cdf25b1975cabd2d71abbcfa2 commit 4ca2fa7b1f25681cdf25b1975cabd2d71abbcfa2 Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 16:13:09 2023 +0100 Solaris: bump alignment to next power of two for aligned_alloc I'm not changing the Valgrind allocator to fit Solaris, too bad. Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 2 ++ 1 file changed, 2 insertions(+) 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 ); \ |