1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

Kernel: Change static constexpr variables to constexpr where possible

Function-local `static constexpr` variables can be `constexpr`. This
can reduce memory consumption, binary size, and offer additional
compiler optimizations.

These changes result in a stripped x86_64 kernel binary size reduction
of 592 bytes.
This commit is contained in:
Lenny Maiorani 2022-02-09 11:33:39 -07:00 committed by Linus Groh
parent 6a4c8a66ae
commit c6acf64558
11 changed files with 26 additions and 15 deletions

View file

@ -2,6 +2,7 @@
* Copyright (c) 2021, Nico Weber <thakis@chromium.org>
* Copyright (c) 2021, Marcin Undak <mcinek@gmail.com>
* Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -99,7 +100,7 @@ void __stack_chk_fail()
extern "C" void exception_common(TrapFrame const* const trap_frame)
{
static constexpr bool print_stack_frame = true;
constexpr bool print_stack_frame = true;
if constexpr (print_stack_frame) {
auto& uart = Prekernel::UART::the();