ftmemsim-valgrind/memcheck/tests/malloc_usable.c
Nicholas Nethercote dbae71819c malloc_usable_size() was totally broken, crashing immediately.
I guess it's not very widely used :)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4439
2005-08-17 04:03:31 +00:00

13 lines
253 B
C

#include <assert.h>
#include <malloc.h>
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
// Since our allocations are in multiples of 8, 99 will round up to 104.
int* x = malloc(99);
assert(104 == malloc_usable_size(x));
return 0;
}