Add support for landlock_create_ruleset (444), landlock_add_rule (445) and landlock_r...
[valgrind.git] / massif / tests / malloc_usable.c
blob0182e6c510d07d90a8d7beb8d2941f1c252f9315
1 #include <assert.h>
2 #include "tests/malloc.h"
3 #include <stdlib.h>
4 #include <stdio.h>
6 int main(void)
8 # if !defined(VGO_darwin) && !defined(VGO_solaris)
9 // Because our allocations are in multiples of 8 or 16, 99 will round up
10 // to 104 or 112.
11 int* x = malloc(99);
13 // XXX: would be better to have a HAVE_MALLOC_USABLE_SIZE variable here
14 assert(104 == malloc_usable_size(x) ||
15 112 == malloc_usable_size(x));
16 assert( 0 == malloc_usable_size(NULL));
17 assert( 0 == malloc_usable_size((void*)0xdeadbeef));
18 # endif
20 return 0;