aboutsummaryrefslogtreecommitdiff
path: root/py/obj.c
diff options
context:
space:
mode:
authorDamien George2016-05-04 10:19:08 +0100
committerDamien George2016-05-04 10:19:08 +0100
commiteb54e4d065a7cbc26dc4c8dc2812d1cabdcd0c50 (patch)
tree0b7350adfb8d57d686b8c45cc68c87776e090a4b /py/obj.c
parent2c2fc070ecca654b0e9a80e1d9a342d46c6f0cdb (diff)
py/obj: Add warning note about get_array return value and GC blocks.
Diffstat (limited to 'py/obj.c')
-rw-r--r--py/obj.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/obj.c b/py/obj.c
index 91dd4c090..9efa0f05a 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -317,6 +317,7 @@ void mp_obj_get_complex(mp_obj_t arg, mp_float_t *real, mp_float_t *imag) {
#endif
#endif
+// note: returned value in *items may point to the interior of a GC block
void mp_obj_get_array(mp_obj_t o, mp_uint_t *len, mp_obj_t **items) {
if (MP_OBJ_IS_TYPE(o, &mp_type_tuple)) {
mp_obj_tuple_get(o, len, items);
@@ -333,6 +334,7 @@ void mp_obj_get_array(mp_obj_t o, mp_uint_t *len, mp_obj_t **items) {
}
}
+// note: returned value in *items may point to the interior of a GC block
void mp_obj_get_array_fixed_n(mp_obj_t o, mp_uint_t len, mp_obj_t **items) {
mp_uint_t seq_len;
mp_obj_get_array(o, &seq_len, items);