Actually mark Unexpected as cold
authorPhil Willoughby <philwill@fb.com>
Thu, 9 Nov 2017 00:38:47 +0000 (16:38 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 9 Nov 2017 01:02:19 +0000 (17:02 -0800)
commit72d6102e41ad80baa66a2b0f9166be3e8066880b
tree7498df159705511651cde176fc5f3322469dd6f5
parent981ea8310405663e4098d72abd027711ddc94422
Actually mark Unexpected as cold

Summary:
Testing indicates that GCC ignores the cold attribute when the function
is available for inlining. Because Unexpected is a template class we
can't make the constructors non-inline, but we can make it derive from a
class with a cold constructor, which has the effect of making all the
Unexpected constructors implicitly cold.

Reviewed By: yfeldblum

Differential Revision: D6261013

fbshipit-source-id: 482e49253d5b104742018133c53fb60279dd9f9b
folly/Expected.h
folly/Makefile.am
folly/lang/ColdClass.cpp [new file with mode: 0644]
folly/lang/ColdClass.h [new file with mode: 0644]
folly/lang/test/ColdClassTest.cpp [new file with mode: 0644]