title: C++ new is 64-byte aligned and equal to cache line size
body: <blockquote>
  <p><strong>Possible Duplicate:</strong><br />
  <a href="https://stackoverflow.com/questions/506518/is-there-any-guarantee-of-alignment-of-address-return-by-cs-new-operation">Is there any guarantee of alignment of address return by C++'s new operation?</a></p>
  </blockquote>
  
  <p>In this program, i am printing each address returned by <strong>new</strong> for unsigned chars. Then deleting them backwards in the end.</p>
  <pre><code>#include &quot;stdafx.h&quot;
  #include&lt;stdlib.h&gt;
  void func();
  
  int main()
  {
      int i=10;
      while(i--&gt;0)printf(&quot;loaded %i \n&quot;, (new unsigned char));
      getchar();
      unsigned char *p=new unsigned char;printf(&quot;last pointer loaded %i \n&quot;, p);
      i=10;
      while(i--&gt;0)delete (p-=64);
      getchar();
      p+=640;
      delete p;//nearly forgot to delete this ^^
      return 0;
  }
  </code></pre>
  <p>output:</p>
  <p><img src="https://i.stack.imgur.com/TWh2L.png" alt="enter image description here" /></p>
  <p>As you can see, each <strong>new</strong> returns 64-byte aligned data.</p>
  <p><strong>Question:</strong> Is this 64-Byte being equal to cache-line size or just a compiler thing?</p>
  <p><strong>Question:</strong> Should i make my structures at mostly 64-bytes long?</p>
  <p><strong>Question:</strong> will this be different when i change my cpu, ram, OS or compiler?</p>
  <p>Pentium-m, VC++ 2010 express, windows-xp</p>
  <p>Thanks.</p>