-
-
Notifications
You must be signed in to change notification settings - Fork 754
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
Function to convert a memory area to a String/ArrayBuffer #738
Comments
For this to be properly useful we'd want jsvStringIterator to be able to handle it as well - this would allow some pretty cool things:
There must be a few other cases this would be useful in too. |
+100 on code directly evaluated from flash! Can you explain why it wouldn't be esp8266 friendly? When you say "jsvStringIterator to be able to handle it as well", what does that mean? (I don't know much about that function.) Would that allow code to be executed from flash without loading it all into RAM? That would be awesome. |
It would be awesome if we could stuff a function into flash! This would do it, wouldn't it? - ie, function bigLongStaticFunction(a,b,c){return eval(E.memoryArea(0xF00D,4000));} // run 4000 byte long block of code from flash starting at address 0xF00D)? |
Yes, something like that would work just fine. It could be useful! |
Potentially you could change both jsvStringIterator and jslex to read a word at a time, but it might hurt performance |
|
E.memoryArea(addr, len) -> ArrayBuffer
Where that ArrayBuffer directly accessed the underlying memory area. In fact
JSV_GET_AS_CHAR_ARRAY
should be able to use the pointer directly.It's not of much use for RAM, but would be amazingly useful for Flash memory (sadly it wouldn't be ESP8266-friendly, but potentially it could be worked around).
Specifically this would be very useful for storing certificates/keys for HTTPS: http://forum.espruino.com/conversations/277780/?offset=25#12650582
The text was updated successfully, but these errors were encountered: