mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-05 11:10:21 +00:00
sizes up to a multiple of 8 (or whatever --alignment is). This is combined with the "admin" bytes, resulting in the "extra" bytes. Added VG_(malloc_usable_size) to the tool interface to support this. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7133
20 lines
539 B
C
20 lines
539 B
C
#include <stdlib.h>
|
|
|
|
int main(void)
|
|
{
|
|
int* x = realloc(NULL, 400); // equivalent to malloc(400), and ends up
|
|
int* y; // calling Valgrind's (and Massif's) malloc
|
|
|
|
x = realloc(x, 400); // same size
|
|
|
|
x = realloc(x, 200); // smaller
|
|
|
|
x = realloc(x, 600); // bigger
|
|
|
|
y = realloc(x+10, 800); // bogus realloc
|
|
|
|
x = realloc(x, 0); // equivalent to free(x), and ends up
|
|
// calling Valgrind's (and Massif's) free
|
|
return 0;
|
|
}
|