title: Does mremap "initialize" memory on growth?
body: <p>If I've <strong>mmap</strong>() some <strong><em>PRIVATE</em></strong> and <strong><em>ANONYMOUS</em></strong> pages and then extend them with <strong>mremap</strong>(), does the new space also get initialized to zeroes?</p>
  
  <p>I've tried reading the code for mremap (<strong>mm/mremap.c</strong>) in the linux source but it requires some domain-specific knowledge that I don't currently have (vma_###  stuff). Not even sure that's the right place to look...</p>
  
  <p>But, from what I've gathered I <em>think</em> that <strong>mremap</strong>()ed memory would be cleared, is this correct?</p>
  
  <p>Allocation is done like this</p>
  
  <pre><code>list = mmap(NULL, newSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)
  </code></pre>
  
  <p>and then remap is done like this</p>
  
  <pre><code>newList = mremap(list, oldSize, newSize, MREMAP_MAYMOVE)
  </code></pre>
  
  <p>Ah, and last, it's a <strong><em>Linux</em></strong> specific question, running a recent kernel (>=2.6.28) and libc (>= 2.11.1)</p>