Page 1 of 1

memory and small int overflow error

Posted: Fri May 29, 2020 4:53 pm
by deepak
Hi,

I have ported minimal micropython to a RTOS, in which core micropython is ported only.
for which i have compiled lib/utils/pyexec.c, lib/utils/stdout_helpers.c, lib/mp-readline/readline.c, minimal/main.c, minimal mpconfigport.h, ports/unix/unix_mphal.c and py files which are described in py.mk.

so when I tried to perform 2-d matrix multiplication of 2 matrix, 1000 times, then it was giving memory error. matrix size 4x4.
can you tell me how can I fix that error and increase the memory size.

In addition to above, when I tried to perform 1-d matrix multiplication of 2 matrix, then it was giving small int overflow. matrix size 10000x10000.

can you help me in this?

Thanks

Re: memory and small int overflow error

Posted: Fri May 29, 2020 10:47 pm
by jcw
The memory error may be caused by not having GC enabled (#define MICROPY_ENABLE_GC 1), as don't have "gc.c" in your list.
For the int overflow, my hunch would be that you need multi-precision support (#define MICROPY_LONGINT_IMPL 1).