Nicholas Nethercote 4ddcff03b9 Merged r9101 (make Massif tests work if VG_MIN_MALLOC_SZB==16) from the
DARWIN branch, along with a few other minor things.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9197
2009-02-18 05:14:44 +00:00

20 lines
615 B
C

#include <stdlib.h>
int main(void)
{ // All sizes are multiples of 16 -- no slop.
int* x = realloc(NULL, 800); // equivalent to malloc(800), and ends up
int* y; // calling Valgrind's (and Massif's) malloc
x = realloc(x, 800); // same size
x = realloc(x, 400); // smaller
x = realloc(x, 1200); // bigger
y = realloc(x+10, 1600); // bogus realloc
x = realloc(x, 0); // equivalent to free(x), and ends up
// calling Valgrind's (and Massif's) free
return 0;
}