This should be straight forward - one instruction per line, roughly 1200 lines.
To start with a get a baseline:
Code: Select all
import gc
print(gc.mem_free())
a=bytearray(180_000)
print(gc.mem_free())
results in:
187568
7552
Makes sense.
Next add 1200 lines of assembly code in 12 routines, some repeating with a different name.
Of course my memory should be less with all that code but this is what I get:
Code: Select all
from micropython import const
import gc
print(gc.mem_free())
a=bytearray(110_000)
print(gc.mem_free())
...a bunch of assembly.....
results in:
183808
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
MemoryError: memory allocation failed, allocating 110000 bytes
Is this right?
Sam