Bug 26792 - Override operator new/delete with const std::nothrow_t& as the second argument
Summary: Override operator new/delete with const std::nothrow_t& as the second argument
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-29 02:12 PDT by Kwang Yul Seo
Modified: 2009-06-30 07:05 PDT (History)
1 user (show)

See Also:


Attachments
Patch to override new/delete, new[]/delete[] with const std::nothrow_t& under Windows CE. (887 bytes, patch)
2009-06-29 02:13 PDT, Kwang Yul Seo
eric: review-
Details | Formatted Diff | Diff
Patch to override new/delete, new[]/delete[] with const std::nothrow_t& under Windows CE. (2.00 KB, patch)
2009-06-30 01:48 PDT, Kwang Yul Seo
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kwang Yul Seo 2009-06-29 02:12:09 PDT
On Windows CE, operator new/delete, new[]/delete[] with const std::nothrow_t& must be overrided because some standard template libraries use these operators.

void *__cdecl operator new(
   size_t count, 
   const std::nothrow_t&
) throw();


The problem occurs when memory allocated by new(size_t s, const std::nothrow_t&) is freed by delete(void* p). This causes the umatched malloc/free.
Comment 1 Kwang Yul Seo 2009-06-29 02:13:48 PDT
Created attachment 32001 [details]
Patch to override new/delete, new[]/delete[] with const std::nothrow_t& under Windows CE.
Comment 2 Eric Seidel (no email) 2009-06-30 00:43:26 PDT
Comment on attachment 32001 [details]
Patch to override new/delete, new[]/delete[] with const std::nothrow_t& under Windows CE.

The spacing around throw() is not consistent in each line.

Also, this is missing a ChangeLog:

http://webkit.org/coding/contributing.html
Comment 3 Kwang Yul Seo 2009-06-30 01:48:58 PDT
Created attachment 32041 [details]
Patch to override new/delete, new[]/delete[] with const std::nothrow_t& under Windows CE.

Add a ChangeLog and make the coding style consistent.
Comment 4 Eric Seidel (no email) 2009-06-30 02:47:22 PDT
This change looks fine to me, but george should be aware of it.
Comment 5 George Staikos 2009-06-30 06:20:32 PDT
Where is a case of this actually happening?
Comment 6 George Staikos 2009-06-30 07:05:41 PDT
r45374