Commit: a37dfa95880f64ffd1498ca2e1a3199639e362bc
Parent: 5cb5256d63ae99ad4e63650b74a9c4ae9c774b5a
Author: Randy Palamar
Date: Wed, 10 Sep 2025 15:29:38 -0600
util: force inline integer rounding functions
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/util.c b/util.c
@@ -559,21 +559,21 @@ push_s8(Arena *a, s8 str)
return result;
}
-function u32
+function force_inline u32
round_down_power_of_2(u32 a)
{
u32 result = 0x80000000UL >> clz_u32(a);
return result;
}
-function u32
+function force_inline u32
round_up_power_of_2(u32 a)
{
u32 result = 0x80000000UL >> (clz_u32(a - 1) - 1);
return result;
}
-function iz
+function force_inline iz
round_up_to(iz value, iz multiple)
{
iz result = value;