AC_CHECK_LIB([rt], [clock_gettime])
AC_CHECK_FUNCS([ \
+ aligned_alloc \
clock_gettime\
copy_file_range \
epoll_create \
#if defined(VGO_solaris)
#define VG_MEMALIGN_ALIGN_POWER_TWO 0
+#define VG_MEMALIGN_NO_ALIGN_ZERO 1
#else
#define VG_MEMALIGN_ALIGN_POWER_TWO 1
+#define VG_MEMALIGN_NO_ALIGN_ZERO 0
#endif
#if defined(VGO_solaris)
DO_INIT; \
MALLOC_TRACE("memalign(alignment %llu, size %llu)", \
(ULong)alignment, (ULong)size ); \
- if ((VG_MEMALIGN_NO_SIZE_ZERO && (alignment == 0)) \
+ if ((VG_MEMALIGN_NO_SIZE_ZERO && (size == 0)) \
+ || (VG_MEMALIGN_NO_ALIGN_ZERO && (alignment == 0)) \
|| (VG_MEMALIGN_ALIGN_POWER_TWO && (alignment & (alignment - 1)) != 0) \
|| (VG_MEMALIGN_ALIGN_FACTOR_FOUR && (alignment % 4 != 0))) { \
SET_ERRNO_EINVAL; \
custom-overlap.stderr.exp custom-overlap.vgtest \
cxx17_aligned_new.stderr.exp cxx17_aligned_new.vgtest \
cxx17_aligned_new.stderr.exp_32 \
+ cxx17_aligned_new.stderr.exp-solaris \
cxx17_aligned_new.stdout.exp \
sized_aligned_new_delete_args.stderr.exp \
sized_aligned_new_delete_args.vgtest \
memalign_test.stderr.exp-freebsd-clang \
memalign_args.vgtest memalign_args.stderr.exp \
memalign_args.stderr.exp-glibc \
+ memalign_args.stderr.exp-darwin \
memcmptest.stderr.exp memcmptest.stderr.exp2 \
memcmptest.stdout.exp memcmptest.vgtest \
memmem.stderr.exp memmem.vgtest \
--- /dev/null
+
+_ZnwmSt11align_val_t(size 64, al 64) = 0x........
+_ZdlPvSt11align_val_t(0x........)
+_ZnamSt11align_val_t(size 320, al 64) = 0x........
+_ZdaPvSt11align_val_t(0x........)
+_ZnwmSt11align_val_t(size 64, al 64) = 0x........
+_ZdlPvmSt11align_val_t(0x........)
+_ZnamSt11align_val_t(size 320, al 64) = 0x........
+_ZdaPvmSt11align_val_t(0x........)
+_ZnwmSt11align_val_tRKSt9nothrow_t(size 64, al 64) = 0x........
+_ZdlPvSt11align_val_tRKSt9nothrow_t(0x........)
+_ZnamSt11align_val_tRKSt9nothrow_t(size 320, al 64) = 0x........
+_ZdaPvSt11align_val_tRKSt9nothrow_t(0x........)
+_Znwm(4) = 0x........
+_ZdlPvSt11align_val_t(0x........)
+_ZnwmRKSt9nothrow_t(4) = 0x........
+_ZdlPvm(0x........)
+_Znam(20) = 0x........
+_ZdaPv(0x........)
+_ZnamRKSt9nothrow_t(20) = 0x........
+_ZdaPv(0x........)
+
+HEAP SUMMARY:
+ in use at exit: ... bytes in ... blocks
+ total heap usage: ... allocs, ... frees, ... bytes allocated
+
+For a detailed leak analysis, rerun with: --leak-check=full
+
+For lists of detected and suppressed errors, rerun with: -s
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
(void)posix_memalign((void **)&mem,align,size);
free(mem);
-#if !defined(VGO_darwin)
+#if defined(HAVE_ALIGNED_ALLOC)
p = aligned_alloc(align, size);
free(p);
#endif
--- /dev/null
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: memalign (vg_replace_malloc.c:...)
+ by 0x........: main (memalign_args.c:19)
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: posix_memalign (vg_replace_malloc.c:...)
+ by 0x........: main (memalign_args.c:23)
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: valloc (vg_replace_malloc.c:...)
+ by 0x........: main (memalign_args.c:31)
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
+#include "../../config.h"
int main(void)
{
+#if defined(HAVE_ALIGNED_ALLOC)
char* p = NULL;
-
// zero size
p = aligned_alloc(0, 8);
assert(p == NULL && errno == EINVAL);
}
assert(p == NULL && errno == ENOMEM);
-
+#endif
}