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
7
8static 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
13static size_t const PROBE_DISTANCE = 1;
14static size_t const INITIAL_CAPACITY = 32;
static size_t const INITIAL_CAPACITY
Definition utils.h:14
static size_t const PROBE_DISTANCE
Definition utils.h:13
static size_t apply_capacity_policy(size_t capacity)
Definition utils.h:8
static size_t next_power_of_2(size_t x)
Definition helpers.h:31