arzp [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=58984 unpack combined with split causes weird behavior in 0.2.3 <p>I have a couple of token count reducer functions:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>function poke_map(loopx,loopy,offsetx,offsety) poke(0x5f38,loopx) poke(0x5f39,loopy) poke(0x5f3a,offsetx) poke(0x5f3b,offsety) end function unpack_split(s) return unpack(split(s)) end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>As of 0.2.3, the latter one of these, especially when combined with the former, as in</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>poke_map(unpack_split&quot;4,4,64,32&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>has started to cause some weird behaviour in cases where cpu usage is high (around 80% or 90%).</p> <p>The most obvious symptom is that actions triggered by a simple global timer (i.e. <em>t += 1</em> in <em>_update60()</em>) start to occur prematurely when the <em>unpack_split()</em> function is called repeatedly in successive <em>_draw()</em> calls.</p> https://www.lexaloffle.com/bbs/?tid=44917 https://www.lexaloffle.com/bbs/?tid=44917 Thu, 07 Oct 2021 18:19:56 UTC