src/kernel/bitmanip.h
// Round down to the nearest power of two
// Find the greatest power of 2 less than or equal to an integer

Round down to the nearest power of two
Find the greatest power of 2 less than or equal to an integer
Round down to the nearest power of two Find the greatest power of 2 less than or equal to an integer
inline static uint32 RoundDownPow2(uint32 value)
    {
      value = value | (value >> 1); 
      value = value | (value >> 2); 
      value = value | (value >> 4); 
      value = value | (value >> 8); 
      value = value | (value >>16); 
      return value - (value >> 1); 
    }
inline static uint32 RoundDownPow2 ( uint32 value ) { value = value | ( value >> 1 ) ; value = value | ( value >> 2 ) ; value = value | ( value >> 4 ) ; value = value | ( value >> 8 ) ; value = value | ( value >> 16 ) ; return value - ( value >> 1 ) ; }
Round down to the nearest power of two
Find the greatest power of 2 less than or equal to an integer
Round down to the nearest power of two Find the greatest power of 2 less than or equal to an integer