title: How does free() know how much memory to free?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1518711/c-programming-how-does-free-know-how-much-to-free">C programming : How does free know how much to free?</a>  </p>
  </blockquote>
  
  
  
  <p>In this snippet </p>
  
  <pre><code>void main() {
  void *p = malloc(300);
  printf("%d",sizeof(*p));
  free(p);
  }
  </code></pre>
  
  <p>How does free know much memory it is supposed release from the void pointer?</p>
  
  <p>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 <code>printf</code> is <code>1</code></p>