title: What happen if deallocate allocated object with malloc using delete
body: <p>What happen if deallocate object allocated with malloc using delete?<br />
  I'm trying making ObjectPool System.<br />
  So I wrote this codes.</p>
  <pre><code>struct A
  {
      int a;
      int b;
      int c;
  
      A()
      {
          std::cout &lt;&lt; &quot;A constructor&quot; &lt;&lt; std::endl;
      }
      ~A()
      {
          std::cout &lt;&lt; &quot;A destructor&quot; &lt;&lt; std::endl;
      }
  };
  
  A* a = (A*)std::malloc(sizeof(A) * 10);
      
  A* a0 = a;
  new (a0) A();
  delete a0; 
  
  A* a1 = a + 1;
  new (a1) A();
  delete a1;  
  
  .
  .
  .
  
  A* a9 = a + 9;
  new (a9) A();
  delete a9;  
  </code></pre>
  <p>Pooling Class allocate multiple objects.<br />
  And Pooling Class don't mind about deallocating.</p>
  <p>But I worried Deallocating memory(allocated with malloc) using delete may make memory leak.
  Does this codes make memory leak?</p>
  <p>I will never call std::free(a).<br />
  Just let user deallocate memory themself.</p>