<font size="2"><font face="tahoma,sans-serif">Hi Stephan;<br></font></font><br><div class="gmail_quote">On Thu, Feb 18, 2010 at 5:30 PM, Stephan Assmus <span dir="ltr">&lt;<a href="mailto:superstippi@gmx.de">superstippi@gmx.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<div><div></div><div class="h5"><br>
On 2010-02-18 at 15:59:35 [+0100], İsmail Dönmez &lt;<a href="mailto:ismail@namtrac.org">ismail@namtrac.org</a>&gt; wrote:<br>
&gt; Picking up and old thread I know...<br>
&gt;<br>
&gt; On Wed, Jan 13, 2010 at 7:19 PM, Darin Adler &lt;<a href="mailto:darin@apple.com">darin@apple.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Yong Li also asked about standard library functions calling new and<br>
&gt; &gt; delete,<br>
&gt; &gt; specifically STL. I believe we have been avoiding calling these functions<br>
&gt; &gt; in<br>
&gt; &gt; WebKit, but I may be mistaken.<br>
&gt; &gt;<br>
&gt;<br>
&gt; Recently I came across some memory corruption issues and turns out that<br>
&gt; WebKit uses std::stable_sort which uses the operator new(nothrow) . I am not<br>
&gt; sure if there is a useful replacement but its good to know about this.<br>
<br>
</div></div>Can you elaborate on this? Were these the cause for your memory corruption?<br>
If yes, where and how did you solve it?<br><br></blockquote><div><br></div><div>For my own WinCE port I override new &amp; delete globally via a special memory pool. I override all 8 signatures of new &amp; delete so its supposed to work fine. But...</div>

<div><br></div><div>std::stable_sort calls operator new(nothrow) which somehow does not pick up my replacement but it does use my delete replacement. So I end up deleting memory I didn&#39;t allocate which as expected crashes.</div>

<div><br></div><div>I am still debugging why STL would not use my replacement function, but meanwhile beware about this :-)</div><div><br></div><div>Regards,</div><div>İsmail</div><div> </div></div>