mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 06:32:44 +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:
		
							parent
							
								
									6a4c8a66ae
								
							
						
					
					
						commit
						c6acf64558
					
				
					 11 changed files with 26 additions and 15 deletions
				
			
		|  | @ -1,6 +1,7 @@ | |||
| /*
 | ||||
|  * Copyright (c) 2020-2021, Liav A. <liavalb@hotmail.co.il> | ||||
|  * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org> | ||||
|  * Copyright (c) 2022, the SerenityOS developers. | ||||
|  * | ||||
|  * SPDX-License-Identifier: BSD-2-Clause | ||||
|  */ | ||||
|  | @ -395,7 +396,7 @@ static bool validate_table(const Structures::SDTHeader& v_header, size_t length) | |||
| // https://uefi.org/specs/ACPI/6.4/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#finding-the-rsdp-on-ia-pc-systems
 | ||||
| UNMAP_AFTER_INIT Optional<PhysicalAddress> StaticParsing::find_rsdp() | ||||
| { | ||||
|     static constexpr auto signature = "RSD PTR "sv; | ||||
|     constexpr auto signature = "RSD PTR "sv; | ||||
|     auto ebda_or_error = map_ebda(); | ||||
|     if (!ebda_or_error.is_error()) { | ||||
|         auto rsdp = ebda_or_error.value().find_chunk_starting_with(signature, 16); | ||||
|  |  | |||
|  | @ -1,6 +1,7 @@ | |||
| /*
 | ||||
|  * Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il> | ||||
|  * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> | ||||
|  * Copyright (c) 2022, the SerenityOS developers. | ||||
|  * | ||||
|  * SPDX-License-Identifier: BSD-2-Clause | ||||
|  */ | ||||
|  | @ -86,7 +87,7 @@ UNMAP_AFTER_INIT void MultiProcessorParser::parse_configuration_table() | |||
| 
 | ||||
| UNMAP_AFTER_INIT Optional<PhysicalAddress> MultiProcessorParser::find_floating_pointer() | ||||
| { | ||||
|     static constexpr auto signature = "_MP_"sv; | ||||
|     constexpr auto signature = "_MP_"sv; | ||||
|     auto ebda_or_error = map_ebda(); | ||||
|     if (!ebda_or_error.is_error()) { | ||||
|         auto mp_floating_pointer = ebda_or_error.value().find_chunk_starting_with(signature, 16); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lenny Maiorani
						Lenny Maiorani