Unified upload and run logic #193
Conversation
|
One additional thought is that this change does redefine the behavior of |
|
For reference the druid changes look like this: ngwese/druid-1@b9a30f6 |
|
these changes sound good! I can help test perhaps late tonight. |
|
I’ll look at the code today but the logic sounds like a great way to move forward!
Just a note (to self?) for testing- should see if the malloc loop leads to memory fragmentation, or if we should just statically allocate the big block.
… On 2 Oct 2019, at 08:19, brian crabtree ***@***.***> wrote:
these changes sound good! I can help test perhaps late tonight.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
I was curious about memory fragmentation as well. My initial approach was to at least start by trying to work within the existing buffer setup and stick to the existing allocation patterns. |
|
perhaps this is the solution for the mac os druid bugs as well? |
- discard upload progress if buffer allocation fails - discard upload if USER_SCRIPT_SIZE is exceeded
|
@tehn - this does not appear to fix the mac druid issues but they might be reduced (just based on my usage of late)? i've redone the commit messages and so far this has been working well for me. |
|
(aside: i think the druid issues are to do with timing in the python script) hoping to get this merged tonight after i can test it a bit more. |
|
Merged this as it seems to be working ok on my setup. i'm going to add a couple helpers & change the init() fn calls & make a PR for druid to capture these things & remove unnecessary |
This is a work in progress intended for discussion as to approach. If this is a reasonable direction to go I will do further testing and cleanup.
The goal is to have consistent upload limitations, parse/eval, and vm reset behavior across the druid
upload(aka flash) andrunoperations.The approach is to have both
uploadandrunperform bulk uploads by issuing a^^s(start) command, sending the script, and then signaling completion with either a new command;^^f(flash), in the upload case or the existing command;^^e(end) in the run case.A cursory amount of testing (with a modified druid) appears to confirm the basic approach works. Items worth noting:
repl_modeis now entirely internal to the repl code.Lua_Reset()is called to free resources ahead of upload buffer allocation because repeated attempts to run code seemed to fail (likely in allocation) and leave the device in an inconsistent state (previously druid would issue a^^kto reset ahead of an upload)REPL_discardmode which simply throws away everything received until such time as either of the^^for^^estop commands are received.USER_SCRIPT_SIZE) the buffer is freed and the repl is put intoREPL_discardmode.