1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:48:13 +00:00

AK+Kernel: Help the compiler inline a bunch of trivial methods

If these methods get inlined, the compiler is able to statically eliminate most
of the assertions. Alas, it doesn't realize this, and believes inlining them to
be too expensive. So give it a strong hint that it's not the case.

This *decreases* the kernel binary size.
This commit is contained in:
Sergey Bugaev 2020-05-20 14:59:31 +03:00 committed by Andreas Kling
parent 36dcbce161
commit d2b500fbcb
6 changed files with 51 additions and 56 deletions

View file

@ -69,13 +69,13 @@ public:
{
}
KResultOr(T&& value)
ALWAYS_INLINE KResultOr(T&& value)
{
new (&m_storage) T(move(value));
}
template<typename U>
KResultOr(U&& value)
ALWAYS_INLINE KResultOr(U&& value)
{
new (&m_storage) T(move(value));
}