PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
fls.c File Reference
#include "c.h"
Include dependency graph for fls.c:

Go to the source code of this file.

Functions

int fls (int mask)
 

Function Documentation

int fls ( int  mask)

Definition at line 55 of file fls.c.

References bit().

Referenced by _hash_get_oldblock_from_newbucket().

56 {
57  int bit;
58 
59  if (mask == 0)
60  return (0);
61  for (bit = 1; mask != 1; bit++)
62  mask = (unsigned int) mask >> 1;
63  return (bit);
64 }
Datum bit(PG_FUNCTION_ARGS)
Definition: varbit.c:361