memcheck: Handle Err_ReallocSizeZero in MC_(eq_Error)
[valgrind.git] / memcheck / tests / memalign_args.c
blob6946ae3a32fd61c0816d266c2dfc1fd37d5e9d03
1 #include <stdlib.h>
2 #include <unistd.h>
3 #if !defined(VGO_darwin)
4 #include <malloc.h>
5 #endif
6 #include "../../config.h"
7 #include "../memcheck.h"
9 int main(void)
11 size_t size = 1024U;
12 size_t align = 64U;
13 char *mem;
14 char *p;
16 (void)VALGRIND_MAKE_MEM_UNDEFINED(&size, sizeof(size));
17 (void)VALGRIND_MAKE_MEM_UNDEFINED(&align, sizeof(align));
18 #if !defined(VGO_darwin)
19 p = memalign(align, size);
20 free(p);
21 #endif
23 (void)posix_memalign((void **)&mem,align,size);
24 free(mem);
26 #if defined(HAVE_ALIGNED_ALLOC)
27 p = aligned_alloc(align, size);
28 free(p);
29 #endif
31 p = valloc(size);
32 free(p);