Numworks Epsilon  1.4.1
Graphing Calculator Operating System
map.c File Reference
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "py/mpconfig.h"
#include "py/misc.h"
#include "py/runtime.h"

Go to the source code of this file.

Functions

STATIC size_t get_hash_alloc_greater_or_equal_to (size_t x)
 
void mp_map_init (mp_map_t *map, size_t n)
 
void mp_map_init_fixed_table (mp_map_t *map, size_t n, const mp_obj_t *table)
 
void mp_map_deinit (mp_map_t *map)
 
void mp_map_clear (mp_map_t *map)
 
STATIC void mp_map_rehash (mp_map_t *map)
 
mp_map_elem_tmp_map_lookup (mp_map_t *map, mp_obj_t index, mp_map_lookup_kind_t lookup_kind)
 

Variables

const mp_map_t mp_const_empty_map
 
STATIC const uint16_t hash_allocation_sizes []
 

Function Documentation

◆ get_hash_alloc_greater_or_equal_to()

STATIC size_t get_hash_alloc_greater_or_equal_to ( size_t  x)

Definition at line 58 of file map.c.

◆ mp_map_clear()

void mp_map_clear ( mp_map_t map)

Definition at line 103 of file map.c.

◆ mp_map_deinit()

void mp_map_deinit ( mp_map_t map)

Definition at line 96 of file map.c.

◆ mp_map_init()

void mp_map_init ( mp_map_t map,
size_t  n 
)

Definition at line 72 of file map.c.

◆ mp_map_init_fixed_table()

void mp_map_init_fixed_table ( mp_map_t map,
size_t  n,
const mp_obj_t table 
)

Definition at line 86 of file map.c.

◆ mp_map_lookup()

mp_map_elem_t* mp_map_lookup ( mp_map_t map,
mp_obj_t  index,
mp_map_lookup_kind_t  lookup_kind 
)

Definition at line 138 of file map.c.

◆ mp_map_rehash()

STATIC void mp_map_rehash ( mp_map_t map)

Definition at line 114 of file map.c.

Variable Documentation

◆ hash_allocation_sizes

STATIC const uint16_t hash_allocation_sizes[]
Initial value:
= {
0, 2, 4, 6, 8, 10, 12,
17, 23, 29, 37, 47, 59, 73,
97, 127, 167, 223, 293, 389, 521, 691, 919, 1223, 1627, 2161,
3229, 4831, 7243, 10861, 16273, 24407, 36607, 54907,
}

Definition at line 51 of file map.c.

◆ mp_const_empty_map

const mp_map_t mp_const_empty_map
Initial value:
= {
.all_keys_are_qstrs = 0,
.is_fixed = 1,
.is_ordered = 1,
.used = 0,
.alloc = 0,
.table = NULL,
}
#define NULL
Definition: stddef.h:4

Definition at line 38 of file map.c.