From c75427baaa9f455497c46f754d6f4e8c594fb897 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 7 Apr 2014 00:54:04 +0100 Subject: [PATCH] py: Revert change to allocation policy for mp_set_t. Seems that this fixes all set tests. --- py/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/map.c b/py/map.c index dadaa22a92..edd9227d5a 100644 --- a/py/map.c +++ b/py/map.c @@ -197,7 +197,7 @@ mp_map_elem_t* mp_map_lookup(mp_map_t *map, mp_obj_t index, mp_map_lookup_kind_t /* set */ void mp_set_init(mp_set_t *set, int n) { - set->alloc = n; + set->alloc = get_doubling_prime_greater_or_equal_to(n + 1); set->used = 0; set->table = m_new0(mp_obj_t, set->alloc); }