py/map: Remove unused new/free functions.
Maps are always allocated "statically" and (de)initialised via mp_map_init and mp_map_deinit.
This commit is contained in:
parent
0e420d48ee
commit
6c9fca2aa9
11
py/map.c
11
py/map.c
|
@ -93,12 +93,6 @@ void mp_map_init_fixed_table(mp_map_t *map, size_t n, const mp_obj_t *table) {
|
||||||
map->table = (mp_map_elem_t*)table;
|
map->table = (mp_map_elem_t*)table;
|
||||||
}
|
}
|
||||||
|
|
||||||
mp_map_t *mp_map_new(size_t n) {
|
|
||||||
mp_map_t *map = m_new(mp_map_t, 1);
|
|
||||||
mp_map_init(map, n);
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Differentiate from mp_map_clear() - semantics is different
|
// Differentiate from mp_map_clear() - semantics is different
|
||||||
void mp_map_deinit(mp_map_t *map) {
|
void mp_map_deinit(mp_map_t *map) {
|
||||||
if (!map->is_fixed) {
|
if (!map->is_fixed) {
|
||||||
|
@ -107,11 +101,6 @@ void mp_map_deinit(mp_map_t *map) {
|
||||||
map->used = map->alloc = 0;
|
map->used = map->alloc = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mp_map_free(mp_map_t *map) {
|
|
||||||
mp_map_deinit(map);
|
|
||||||
m_del_obj(mp_map_t, map);
|
|
||||||
}
|
|
||||||
|
|
||||||
void mp_map_clear(mp_map_t *map) {
|
void mp_map_clear(mp_map_t *map) {
|
||||||
if (!map->is_fixed) {
|
if (!map->is_fixed) {
|
||||||
m_del(mp_map_elem_t, map->table, map->alloc);
|
m_del(mp_map_elem_t, map->table, map->alloc);
|
||||||
|
|
Loading…
Reference in New Issue