summaryrefslogtreecommitdiff
path: root/py/objlist.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-02-27 00:36:39 +0000
committerDamien George <damien.p.george@gmail.com>2015-02-27 00:36:39 +0000
commit4852e09c7914a4d4f2938dddbe155a2075bb2eb3 (patch)
treec1a6677c13cd5394a0c574eea31d1f33259edcd3 /py/objlist.c
parentd155fecf9e27617d23a2249dacdbbcc203bdd85e (diff)
py: Fix adding of traceback so that it appends to existing info.
This makes exception traceback info self contained (ie doesn't rely on list object, which was a bit of a hack), reduces code size, and reduces RAM footprint of exception by eliminating the list object. Addresses part of issue #1126.
Diffstat (limited to 'py/objlist.c')
-rw-r--r--py/objlist.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/py/objlist.c b/py/objlist.c
index e9af3652b..e0c895375 100644
--- a/py/objlist.c
+++ b/py/objlist.c
@@ -477,25 +477,6 @@ mp_obj_t mp_obj_new_list(mp_uint_t n, mp_obj_t *items) {
return o;
}
-// Special method for usage with exceptions
-// Doesn't initialize items, assumes they will be initialized by client.
-mp_obj_t mp_obj_new_list_maybe(mp_uint_t n) {
- mp_obj_list_t *o = m_new_obj_maybe(mp_obj_list_t);
- if (!o) {
- return o;
- }
- o->items = m_new_maybe(mp_obj_t, n);
- if (!o->items) {
- m_del_obj(mp_obj_list_t, o);
- return MP_OBJ_NULL;
- }
-
- o->base.type = &mp_type_list;
- o->len = o->alloc = n;
-
- return o;
-}
-
void mp_obj_list_get(mp_obj_t self_in, mp_uint_t *len, mp_obj_t **items) {
mp_obj_list_t *self = self_in;
*len = self->len;