memcheck: on arm64, use expensive instrumentation for Cmp{EQ,NE}64 by default.
[valgrind.git] / memcheck / tests / memalign_test.c
blobf7fd8554f2484bb4f2ca37ffb06d81a2f3093e32
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <unistd.h>
5 #include <assert.h>
7 int main ( void )
9 void* a[10];
10 int i;
11 unsigned long pszB = sysconf(_SC_PAGE_SIZE);
12 assert(sizeof(long) == sizeof(void*));
13 assert(pszB == 4096 || pszB == 8192 || pszB == 16384 || pszB == 32768 || pszB == 65536); /* All on one line to match linenumbers in the .exp file. */
15 for (i = 0; i < 10; i++) {
16 a[i] = valloc(11111 * (i+1));
17 /* check valloc really is returning page-aligned memory */
18 assert( (((unsigned long)(a[i])) % pszB) == 0 );
19 // printf("I acquire %p\n", a[i]);
21 for (i = 0; i < 10; i++) {
22 // printf("I release %p\n", a[i]);
23 free(a[i]);
25 free(a[9]);
26 return 0;