mirror of
https://github.com/micropython/micropython.git
synced 2025-09-07 02:10:52 +02:00
16 lines
286 B
JavaScript
16 lines
286 B
JavaScript
// Test expanding the MicroPython GC heap.
|
|
|
|
const mp = await (await import(process.argv[2])).loadMicroPython();
|
|
|
|
mp.runPython(`
|
|
import gc
|
|
bs = []
|
|
for i in range(24):
|
|
b = bytearray(1 << i)
|
|
bs.append(b)
|
|
gc.collect()
|
|
print(gc.mem_free())
|
|
for b in bs:
|
|
print(len(b))
|
|
`);
|