Derive-C
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1
#pragma once
2
#include <stddef.h>
3
#include <stdint.h>
4
5
#include <
derive-c/core/helpers.h
>
6
#include <
derive-c/core/panic.h
>
7
8
static
inline
size_t
apply_capacity_policy
(
size_t
capacity) {
9
// TODO(oliverkillane): play with overallocation policy
10
return
next_power_of_2
(capacity + (capacity / 2));
11
}
12
13
static
size_t
const
PROBE_DISTANCE
= 1;
14
static
size_t
const
INITIAL_CAPACITY
= 32;
INITIAL_CAPACITY
static size_t const INITIAL_CAPACITY
Definition
utils.h:14
PROBE_DISTANCE
static size_t const PROBE_DISTANCE
Definition
utils.h:13
apply_capacity_policy
static size_t apply_capacity_policy(size_t capacity)
Definition
utils.h:8
helpers.h
next_power_of_2
static size_t next_power_of_2(size_t x)
Definition
helpers.h:31
panic.h
src
derive-c
structures
hashmap
utils.h
Generated by
1.14.0