Possible Duplicate:
C programming : How does free know how much to free?
When we are allocating some memory from the heap using mallolc or calloc or even realloc, we are giving the pointer and the size of the memory which we want to allocate. But while freeing that allocated memory, we are providing only pointer (base address of the allocated memory). So my Question is how the free() function knows how much memory it has to free. means the size of the memory.