[webkit-dev] global new/delete operator in WebKit
ismail at namtrac.org
Thu Feb 18 07:36:13 PST 2010
On Thu, Feb 18, 2010 at 5:30 PM, Stephan Assmus <superstippi at gmx.de> wrote:
> On 2010-02-18 at 15:59:35 [+0100], İsmail Dönmez <ismail at namtrac.org>
> > Picking up and old thread I know...
> > On Wed, Jan 13, 2010 at 7:19 PM, Darin Adler <darin at apple.com> wrote:
> > > Yong Li also asked about standard library functions calling new and
> > > delete,
> > > specifically STL. I believe we have been avoiding calling these
> > > in
> > > WebKit, but I may be mistaken.
> > >
> > Recently I came across some memory corruption issues and turns out that
> > WebKit uses std::stable_sort which uses the operator new(nothrow) . I am
> > sure if there is a useful replacement but its good to know about this.
> Can you elaborate on this? Were these the cause for your memory corruption?
> If yes, where and how did you solve it?
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
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.
I am still debugging why STL would not use my replacement function, but
meanwhile beware about this :-)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev