PostgreSQL Source Code  git master
dynahash.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int my_log2 (long num)
 

Function Documentation

◆ my_log2()

int my_log2 ( long  num)

Definition at line 1760 of file dynahash.c.

1761 {
1762  /*
1763  * guard against too-large input, which would be invalid for
1764  * pg_ceil_log2_*()
1765  */
1766  if (num > LONG_MAX / 2)
1767  num = LONG_MAX / 2;
1768 
1769 #if SIZEOF_LONG < 8
1770  return pg_ceil_log2_32(num);
1771 #else
1772  return pg_ceil_log2_64(num);
1773 #endif
1774 }
static uint64 pg_ceil_log2_64(uint64 num)
Definition: pg_bitutils.h:267
static uint32 pg_ceil_log2_32(uint32 num)
Definition: pg_bitutils.h:254

References pg_ceil_log2_32(), and pg_ceil_log2_64().

Referenced by ExecHashTableCreate(), ExecParallelHashTableSetCurrentBatch(), hash_choose_num_partitions(), hash_create(), MultiExecParallelHash(), next_pow2_int(), next_pow2_long(), and subxact_info_read().