gecko-dev/memory/fallible
Mike Hommey 154fd9c9ad Bug 1424116 - Change the definition of mozilla::fallible again. r=njn
In bug 1423803, mozilla::fallible was made an "alias" of std::nothrow.
Except C++ doesn't allow compilers to be too smart, and in many cases,
they would actually create data fields to hold a copy of std::nothrow,
even creating a static initializer on non-optimized builds to do so.

By turning it into a reference, we allow compilers to just use
std::nothrow directly, as if it were passed directly, but they can still
create unused data fields. Turning it into a static allows compilers to
skip the data fields altogether.

On a local linux64 build, this saves 242 bytes of .bss.

Note this does change a `lea` (address calculation) into a `mov` (read),
but it shouldn't matter too much.

--HG--
extra : rebase_source : 9c08e8263aef267b8ad5962b0248c7effcb67796
2017-12-08 11:51:59 +09:00
..
fallible.cpp
fallible.h Bug 1424116 - Change the definition of mozilla::fallible again. r=njn 2017-12-08 11:51:59 +09:00
moz.build