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/prelude.h
>
6
7
static
inline
size_t
dc_apply_capacity_policy
(
size_t
capacity) {
8
// TODO(oliverkillane): play with overallocation policy
9
return
dc_math_next_power_of_2
(capacity + (capacity / 2));
10
}
11
12
static
size_t
const
DC_INITIAL_CAPACITY
= 32;
prelude.h
dc_apply_capacity_policy
static size_t dc_apply_capacity_policy(size_t capacity)
Definition
utils.h:7
DC_INITIAL_CAPACITY
static size_t const DC_INITIAL_CAPACITY
Definition
utils.h:12
dc_math_next_power_of_2
static DC_INLINE DC_CONST size_t dc_math_next_power_of_2(size_t x)
Definition
math.h:46
src
derive-c
container
map
decomposed
utils.h
Generated by
1.15.0