RynthSuite as of 2026-12-02 (internal 152e13d): release 2026.12.1.1
This commit is contained in:
parent
e8e4228d15
commit
6b5a9c7e99
65 changed files with 3920 additions and 237 deletions
|
|
@ -530,10 +530,17 @@ public sealed partial class RynthLuaPlugin
|
|||
long alloc0 = LuaScriptHost.AllocationMark();
|
||||
try
|
||||
{
|
||||
DynValue co = s.CreateCoroutine(runner);
|
||||
// A pooled worker (LuaScriptHost: a new coroutine is ~1 MB) when the host has them.
|
||||
LuaScriptHost host = hud.Ctx.Host;
|
||||
DynValue? worker = host.RentWorker();
|
||||
DynValue co = worker ?? s.CreateCoroutine(runner);
|
||||
co.Coroutine.AutoYieldCounter = PassInstructionCap;
|
||||
DynValue r = co.Coroutine.Resume(DynValue.NewTable(list));
|
||||
if (co.Coroutine.State != CoroutineState.Dead)
|
||||
DynValue r = worker != null
|
||||
? co.Coroutine.Resume(host.WorkerArgs(runner, new[] { DynValue.NewTable(list) }))
|
||||
: co.Coroutine.Resume(DynValue.NewTable(list));
|
||||
if (worker != null && host.IsWorkerDone(r))
|
||||
host.ReturnWorker(co); // the pass ran to its end; anything else drops the worker
|
||||
else if (co.Coroutine.State != CoroutineState.Dead)
|
||||
{
|
||||
error = r.Type == DataType.YieldRequest
|
||||
? $"OnRender ran too long (over {PassInstructionCap} instructions); the last good frame stays"
|
||||
|
|
|
|||
Loading…
Reference in a new issue