From d891452a73165966497f1c79b64276faaa664597 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 27 Feb 2015 09:54:12 +0000 Subject: py: Add MICROPY_MALLOC_USES_ALLOCATED_SIZE to allow simpler malloc API. --- py/objarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/objarray.c') diff --git a/py/objarray.c b/py/objarray.c index e030548bbb..e3a59a0f89 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -373,7 +373,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value if (len_adj > 0) { if (len_adj > o->free) { // TODO: alloc policy; at the moment we go conservative - o->items = m_realloc(o->items, (o->len + o->free) * item_sz, (o->len + len_adj) * item_sz); + o->items = m_renew(byte, o->items, (o->len + o->free) * item_sz, (o->len + len_adj) * item_sz); o->free = 0; } mp_seq_replace_slice_grow_inplace(o->items, o->len, -- cgit v1.2.3