Derive-C
Loading...
Searching...
No Matches
utils.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <derive-c/core/helpers.h>
#include <derive-c/core/panic.h>
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static size_t apply_capacity_policy (size_t capacity)

Variables

static size_t const PROBE_DISTANCE = 1
static size_t const INITIAL_CAPACITY = 32

Function Documentation

◆ apply_capacity_policy()

size_t apply_capacity_policy ( size_t capacity)
inlinestatic

Definition at line 8 of file utils.h.

8 {
9 // TODO(oliverkillane): play with overallocation policy
10 return next_power_of_2(capacity + (capacity / 2));
11}
static size_t next_power_of_2(size_t x)
Definition helpers.h:31
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ INITIAL_CAPACITY

size_t const INITIAL_CAPACITY = 32
static

Definition at line 14 of file utils.h.

◆ PROBE_DISTANCE

size_t const PROBE_DISTANCE = 1
static

Definition at line 13 of file utils.h.