Created attachment 567579 [details] [diff] [review] add throw(std::bad_alloc) 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.
I'd rename the macros since the names after this patch would just be lies.
I don't see how they are more lies than before.
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
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