Closed
Bug 695171
Opened 13 years ago
Closed 13 years ago
Make our operator new throw bad_alloc
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
FIXED
mozilla10
People
(Reporter: jrmuizel, Assigned: jrmuizel)
Details
Attachments
(1 file)
1.07 KB,
patch
|
cjones
:
review+
|
Details | Diff | Splinter Review |
If new doesn't throw bad_alloc the compiler emits a null check after to avoid calling the constructor. http://llvm.org/bugs/show_bug.cgi?id=10895 Adding throw(std::bad_alloc) shaves 57KB of .text off a gcc mac build. I expect it would take more off the clang build.
Attachment #567579 -
Flags: review?(jones.chris.g)
Comment 1•13 years ago
|
||
I'd rename the macros since the names after this patch would just be lies.
Assignee | ||
Comment 2•13 years ago
|
||
I don't see how they are more lies than before.
Updated•13 years ago
|
Attachment #567579 -
Flags: review?(jones.chris.g) → review+
Comment 3•13 years ago
|
||
As promised to Jeff, I measured how much of a size change this caused with Mac. The answer is 0. __TEXT __DATA __OBJC others dec hex 24739840 2547712 0 24514560 51802112 3167000 obj-ff-opt/dist/Nightly2.app/Contents/MacOS/XUL 24739840 2547712 0 24514560 51802112 3167000 obj-ff-opt/dist/Nightly.app/Contents/MacOS/XUL
Assignee | ||
Comment 4•13 years ago
|
||
Fortunately, my results don't match Ehsan's. /tmp$ size XUL-pre __TEXT __DATA __OBJC others dec hex 24637440 2539520 0 24469504 51646464 3141000 /tmp$ size XUL-post __TEXT __DATA __OBJC others dec hex 24576000 2539520 0 24469504 51585024 3132000 Which gives a savings of 61KB
Comment 5•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/2606bc44cb7c
Assignee: nobody → jmuizelaar
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in
before you can comment on or make changes to this bug.
Description
•