Possible Duplicate:
C programming : How does free know how much to free?
In this snippet
void main() {
void *p = malloc(300);
printf("%d",sizeof(*p));
free(p);
}
How does free know much memory it is supposed release from the void pointer?
I figure, if there is an internal table/function, it should be available to find out sizes of any kind of objects, whereas the output of the printf
is 1