summaryrefslogtreecommitdiff
path: root/py/map.c
diff options
context:
space:
mode:
authorDamien <damien.p.george@gmail.com>2013-12-29 19:33:23 +0000
committerDamien <damien.p.george@gmail.com>2013-12-29 19:33:23 +0000
commit732407f1bf12364375162e8fb73816532a5d139c (patch)
treebf795d7bab01d6d603eec761affac7091be9606a /py/map.c
parenta1c8e5737cebba08909104d47c1dfd16ef80e6a1 (diff)
Change memory allocation API to require size for free and realloc.
Diffstat (limited to 'py/map.c')
-rw-r--r--py/map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/map.c b/py/map.c
index 3c2d1fbb5..01209c9b7 100644
--- a/py/map.c
+++ b/py/map.c
@@ -64,7 +64,7 @@ mp_map_elem_t* mp_map_lookup_helper(mp_map_t *map, mp_obj_t index, bool add_if_n
mp_map_lookup_helper(map, old_table[i].key, true)->value = old_table[i].value;
}
}
- m_free(old_table);
+ m_del(mp_map_elem_t, old_table, old_alloc);
// restart the search for the new element
pos = hash % map->alloc;
} else {
@@ -124,7 +124,7 @@ mp_obj_t mp_set_lookup(mp_set_t *set, mp_obj_t index, bool add_if_not_found) {
mp_set_lookup(set, old_table[i], true);
}
}
- m_free(old_table);
+ m_del(mp_obj_t, old_table, old_alloc);
// restart the search for the new element
pos = hash % set->alloc;
} else {