#include <stddef.h>
#include <stdint.h>
#include <derive-c/core.h>
#include <derive-c/panic.h>
Go to the source code of this file.
◆ apply_capacity_policy()
static size_t apply_capacity_policy |
( |
size_t | capacity | ) |
|
|
inlinestatic |
Definition at line 10 of file utils.h.
10 {
11
13}
static size_t next_power_of_2(size_t x)
◆ is_power_of_2()
static bool is_power_of_2 |
( |
size_t | x | ) |
|
|
inlinestatic |
Definition at line 8 of file utils.h.
8{ return x != 0 && (x & (x - 1)) == 0; }
◆ modulus_capacity()
static size_t modulus_capacity |
( |
size_t | index, |
|
|
size_t | capacity ) |
|
inlinestatic |
Definition at line 15 of file utils.h.
15 {
17
18 return index & (capacity - 1);
19}
#define DEBUG_ASSERT(expr)
static bool is_power_of_2(size_t x)
◆ INITIAL_CAPACITY
size_t const INITIAL_CAPACITY = 32 |
|
static |
◆ PROBE_DISTANCE
size_t const PROBE_DISTANCE = 1 |
|
static |