mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:12:46 +00:00 
			
		
		
		
	AK: Add a useful align_up_to(value, power_of_two) function
This commit is contained in:
		
							parent
							
								
									db48dfcaaf
								
							
						
					
					
						commit
						bcfdf9ffa7
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -73,4 +73,9 @@ static_assert(explode_byte(0x80) == 0x80808080); | |||
| static_assert(explode_byte(0x7f) == 0x7f7f7f7f); | ||||
| static_assert(explode_byte(0) == 0); | ||||
| 
 | ||||
| inline constexpr size_t align_up_to(const size_t value, const size_t alignment) | ||||
| { | ||||
|     return (value + (alignment - 1)) & ~(alignment - 1); | ||||
| } | ||||
| 
 | ||||
| enum class TriState : u8 { False, True, Unknown }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling