Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / darwin / aligned_alloc.c
blobbcbae51fe40417e95909e5a35f0c9f4bb4cbf375
1 #include <stdlib.h>
2 #include <assert.h>
3 #include "../../../config.h"
5 int main(void)
7 // @todo PJF this is a placeholder for 10.15 and later support
8 #if !defined(VGO_darwin)
9 char* p = NULL;
11 // zero size
12 p = aligned_alloc(0, 8);
13 assert(p == NULL);
14 // non multiple of alignment fails on Darwin
15 p = aligned_alloc(8, 25);
16 assert(p == NULL);
17 // align not power of 2
18 p = aligned_alloc(40, 160);
19 assert(p == NULL);
20 #endif
22 // @todo PJF this works standalone
23 // but for some reason it doesn't fail in arena_memalign
24 // and I see
25 // ==25899== Warning: set address range perms: large range [0x1000, 0x1000000001000) (defined)
28 #if 0
29 // too big
30 if (sizeof(size_t) == 8)
32 p = aligned_alloc(16, 1UL<<48);
34 else
36 p = NULL;
39 assert(p == NULL);
40 #endif