mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-06 03:23:58 +00:00
DARWIN branch, along with a few other minor things. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9197
20 lines
615 B
C
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;
|
|
}
|