<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"><<a href="mailto:superstippi@gmx.de">superstippi@gmx.de</a>></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 <<a href="mailto:ismail@namtrac.org">ismail@namtrac.org</a>> wrote:<br>
> Picking up and old thread I know...<br>
><br>
> On Wed, Jan 13, 2010 at 7:19 PM, Darin Adler <<a href="mailto:darin@apple.com">darin@apple.com</a>> wrote:<br>
><br>
> > Yong Li also asked about standard library functions calling new and<br>
> > delete,<br>
> > specifically STL. I believe we have been avoiding calling these functions<br>
> > in<br>
> > WebKit, but I may be mistaken.<br>
> ><br>
><br>
> Recently I came across some memory corruption issues and turns out that<br>
> WebKit uses std::stable_sort which uses the operator new(nothrow) . I am not<br>
> 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 & delete globally via a special memory pool. I override all 8 signatures of new & 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'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>