]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Solaris: bump alignment to next power of two for aligned_alloc
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 5 Mar 2023 15:13:09 +0000 (16:13 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 5 Mar 2023 15:13:09 +0000 (16:13 +0100)
I'm not changing the Valgrind allocator to fit Solaris, too bad.

coregrind/m_replacemalloc/vg_replace_malloc.c

index 09c1dccdb1de50e3143b28ed88f7d89a3dc306e8..b00d33d497f78c71be60c832cedb1199ab68e8c2 100644 (file)
@@ -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 ); \