-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Introduce abstraction (like pointer indirection) for memory read/write? #4140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This would be a huge overhead for speed (and also code size). There are really two discussions here: 1) general pointer indirection to help with a compacting collector; 2) supporting custom memory mapping of bytecode so it can remain in external storage. For the latter, a more efficient and realistic approach would be to have a bytecode cache in RAM, which would hold the most recently used bytecode functions. Bytecode would be loaded on demand from storage and executed from RAM. |
You forgot The compilation process can take way more RAM than the actual I know I'm asking about implementing an OS-ish feature - "virtual memory lite" - but because micropython is often run on bare-metal, I think it's a valid capability to implement as part of micropython. |
fix bitmap_font path in display resource gen
Closing due to inactivity. |
Uh oh!
There was an error while loading. Please reload this page.
Memory read/write abstraction - pointer indirection - has been mentioned as a possible route #1168 to implement precise garbage collector but I think introducing such a thing has additional uses.
Remember that micropython is often run on bare-metal (cc @peterhinch ) and we're using C to implement it so we don't have the nifty tricks of operator overloading of C++ (sigh) i.e. we cannot redefine the
*
dereferencing operator.Executing from flash
In #4124 I inquire of the possibility of running a
.mpy
from flash and @dpgeorge answers with a straightforward solution. However there is a large constraint:If we had indirection, the code wouldn't have to be contiguous because the VM code's reading of the opcodes -
switch (*ip++)
- would be replaced withswitch(GET(ip))
(or something).Once you can execute from ANY flash location you can save the
mp_raw_code_t
to flash after youimport
.RAM! (my precious)
Everyone wants to save RAM by any tricks in
.py
code but parsing and compilation are a huge low-ish hanging fruit. We could save the parse-tree and other artifacts in flash.The text was updated successfully, but these errors were encountered: