brilliantlabsAR / monocle-micropython

Micropython ported to the Monocle
ISC License
215 stars 27 forks source link

Enable `micropython.mem_info(True)` report in `mpconfigport.h` #264

Closed josuah closed 11 months ago

josuah commented 1 year ago

https://docs.micropython.org/en/latest/library/micropython.html?highlight=mem_info#micropython.mem_info https://github.com/adafruit/circuitpython/blob/main/py/mpconfig.h#L1234-L1237

This allows to call mem_info(True) to have an extended report of the RAM, convenient for application developer in addition to core firmware developers.

>>> micropython.mem_info(True)
stack: 864 out of 7680
GC: total: 40192, used: 21632, free: 18560
 No. of 1-blocks: 123, 2-blocks: 23, max blk sz: 1024, max free sz: 1150
GC memory layout; from 20004300:
00000000: h=BLhhhBDh=TBBhB=TB=h==h===hhAh=================================
00000400: ================================================================
00000800: ================================================================
00000c00: ================================================================
00001000: ================================================================
00001400: ================================================================
00001800: ================================================================
00001c00: ================================================================
00002000: ================================================================
00002400: ================================================================
00002800: ================================================================
00002c00: ================================================================
00003000: ================================================================
00003400: ================================================================
00003800: ================================================================
00003c00: ================================================================
00004000: ==============================h==h=======h=======h==============
00004400: ===h=======h=======h=hhBMDBTBDBBh=h===DBTB=BTBh==h===BDhTTB=hBBD
00004800: BTB=BTBh==h===BDhTh===h=h===DhTTB=hh=h===BDBBBTBh==h===BDhTBhh=h
00004c00: ===BDBTB=BTBh==h===h=============================BDBTB=BBBBBTh==
00005000: =h====BBBBBBBBhShh=h=hhBh=hhhhBh=hhh=hhhBh=hhhhh==hBhhhhhhh==B..
00005400: ..h=.h==.....h=h==..............................................
       (17 lines all free)
00009c00: ................
>>>