title: Heap memory exploration with malloc
body: <p>I've written a program that takes 3 number in input:</p>
  
  <ul>
  <li><ol>
  <li>The size of memory to allocate in the heap with <code>malloc()</code></li>
  </ol></li>
  <li><ol start="2">
  <li>Two <code>int</code> value</li>
  </ol></li>
  </ul>
  
  <p>If <code>q</code> is an <code>unsigned char</code> pointer it gives <code>q[i]=b</code> from <code>q[min]</code> to <code>q[max]</code>.</p>
  
  <p>I thought that the heap was divided in pages and that the first call to <code>malloc()</code> would have given a pointer to the first byte of the page of my process. So why if try to get <code>q[-1]</code> my process is not killed?</p>
  
  <p>Then I've tried with another pointer <code>p</code> and I noticed that between the two pointers there is a distance of 32byte, why they are not adjacent?</p>
  
  <p>The last thing I notice is that both in <code>p[-8]=q[-40(-32-8)]</code> and <code>q[-8]</code> there is the number <code>33 00100001</code> (all the other bytes are setted to 0), it means anything?</p>
  
  <p>Thank you!</p>