micropthon需要多少栈?

版权声明:本文为博主unsv29原创文章,未经博主允许不得转载。 https://blog.csdn.net/unsv29/article/details/84898106

经过尝试micropython需要0xC84=3204字节栈。如果小于这个,那么要么是进入harddefault,要么弹出assert提示,要么卡在micropython内部的某个函数出不来了。

我运行的是

    mp_init();
    do_str("print(1+1,'hello world!', list(x+1 for x in range(10)), end='eol\\n')", MP_PARSE_SINGLE_INPUT);
    do_str("for i in range(10):\n  print(i)", MP_PARSE_FILE_INPUT);
    printf("\r\n--------\r\n");
    do_str("print(3*4*712)", MP_PARSE_FILE_INPUT);
    mp_deinit(); 
    while (1);

至于内部的事情,要多多少少了解一些。安全才是最重要的。

猜你喜欢

转载自blog.csdn.net/unsv29/article/details/84898106