@@ -669,7 +669,7 @@ void mp_call_prepare_args_n_kw_var(bool have_self, size_t n_args_n_kw, const mp_
669
669
670
670
// allocate memory for the new array of args
671
671
args2_alloc = 1 + n_args + 2 * (n_kw + kw_dict_len );
672
- args2 = m_new ( mp_obj_t , args2_alloc );
672
+ args2 = mp_nonlocal_alloc ( args2_alloc * sizeof ( mp_obj_t ) );
673
673
674
674
// copy the self
675
675
if (self != MP_OBJ_NULL ) {
@@ -690,7 +690,7 @@ void mp_call_prepare_args_n_kw_var(bool have_self, size_t n_args_n_kw, const mp_
690
690
691
691
// allocate memory for the new array of args
692
692
args2_alloc = 1 + n_args + len + 2 * (n_kw + kw_dict_len );
693
- args2 = m_new ( mp_obj_t , args2_alloc );
693
+ args2 = mp_nonlocal_alloc ( args2_alloc * sizeof ( mp_obj_t ) );
694
694
695
695
// copy the self
696
696
if (self != MP_OBJ_NULL ) {
@@ -706,7 +706,7 @@ void mp_call_prepare_args_n_kw_var(bool have_self, size_t n_args_n_kw, const mp_
706
706
707
707
// allocate memory for the new array of args
708
708
args2_alloc = 1 + n_args + 2 * (n_kw + kw_dict_len ) + 3 ;
709
- args2 = m_new ( mp_obj_t , args2_alloc );
709
+ args2 = mp_nonlocal_alloc ( ar
10000
gs2_alloc * sizeof ( mp_obj_t ) );
710
710
711
711
// copy the self
712
712
if (self != MP_OBJ_NULL ) {
@@ -723,7 +723,7 @@ void mp_call_prepare_args_n_kw_var(bool have_self, size_t n_args_n_kw, const mp_
723
723
mp_obj_t item ;
724
724
while ((item = mp_iternext (iterable )) != MP_OBJ_STOP_ITERATION ) {
725
725
if (args2_len >= args2_alloc ) {
726
- args2 = m_renew ( mp_obj_t , args2 , args2_alloc , args2_alloc * 2 );
726
+ args2 = mp_nonlocal_realloc ( args2 , args2_alloc * sizeof ( mp_obj_t ) , args2_alloc * 2 * sizeof ( mp_obj_t ) );
727
727
args2_alloc *= 2 ;
728
728
}
729
729
args2 [args2_len ++ ] = item ;
@@ -774,7 +774,7 @@ void mp_call_prepare_args_n_kw_var(bool have_self, size_t n_args_n_kw, const mp_
774
774
if (new_alloc < 4 ) {
775
775
new_alloc = 4 ;
776
776
}
777
- args2 = m_renew ( mp_obj_t , args2 , args2_alloc , new_alloc );
777
+ args2 = mp_nonlocal_realloc ( args2 , args2_alloc * sizeof ( mp_obj_t ) , new_alloc * sizeof ( mp_obj_t ) );
778
778
args2_alloc = new_alloc ;
779
779
}
780
780
@@ -806,7 +806,7 @@ mp_obj_t mp_call_method_n_kw_var(bool have_self, size_t n_args_n_kw, const mp_ob
806
806
mp_call_prepare_args_n_kw_var (have_self , n_args_n_kw , args , & out_args );
807
807
808
808
mp_obj_t res = mp_call_function_n_kw (out_args .fun , out_args .n_args , out_args .n_kw , out_args .args );
809
- m_del ( mp_obj_t , out_args .args , out_args .n_alloc );
809
+ mp_nonlocal_free ( out_args .args , out_args .n_alloc * sizeof ( mp_obj_t ) );
810
810
811
811
return res ;
812
812
}
0 commit comments