From ba36180fd7b68341ad57e0fbe7a55cdfb334908d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 2 Nov 2017 09:28:56 -0200 Subject: new API for 'lua_resume' + cleaning the uses of the 'extra' field in 'CallInfo' --- lstate.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index 76ce110f..8b9eb606 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.144 2017/07/27 13:50:16 roberto Exp roberto $ +** $Id: lstate.h,v 2.145 2017/10/31 17:54:35 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -83,12 +83,6 @@ typedef struct stringtable { /* ** Information about a call. -** When a thread yields, 'func' is adjusted to pretend that the -** top function has only the yielded values in its stack; in that -** case, the actual 'func' value is saved in field 'extra'. -** When a function calls another with a continuation, 'extra' keeps -** the function index so that, in case of errors, the continuation -** function can be called with the correct top. */ typedef struct CallInfo { StkId func; /* function index in the stack */ @@ -104,7 +98,10 @@ typedef struct CallInfo { lua_KContext ctx; /* context info. in case of yields */ } c; } u; - ptrdiff_t extra; + union { + ptrdiff_t funcidx; /* called-function index */ + int nyield; /* number of values yielded */ + } u2; short nresults; /* expected number of results from this function */ unsigned short callstatus; } CallInfo; -- cgit v1.2.3-55-g6feb