From 70a63fa5adfb2480ce385502f1d0306000217690 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 8 Apr 2009 15:04:33 -0300 Subject: first implementation of yieldable 'pcall' --- lstate.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index 2cbb95e5..c9155a94 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.39 2009/03/10 17:14:37 roberto Exp roberto $ +** $Id: lstate.h,v 2.40 2009/03/23 14:26:12 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -90,6 +90,10 @@ typedef struct CallInfo { struct { /* only for C functions */ int ctx; /* context info. in case of yields */ lua_CFunction k; /* continuation in case of yields */ + ptrdiff_t old_errfunc; + ptrdiff_t oldtop; + lu_byte old_allowhook; + lu_byte status; } c; } u; } CallInfo; @@ -98,11 +102,13 @@ typedef struct CallInfo { /* ** Bits in CallInfo status */ -#define CIST_LUA 1 /* call is running a Lua function */ -#define CIST_HOOKED 2 /* call is running a debug hook */ -#define CIST_REENTRY 4 /* call is running on same invocation of +#define CIST_LUA (1<<0) /* call is running a Lua function */ +#define CIST_HOOKED (1<<1) /* call is running a debug hook */ +#define CIST_REENTRY (1<<2) /* call is running on same invocation of luaV_execute of previous call */ -#define CIST_CTX 8 /* call has a ctx value */ +#define CIST_YIELDED (1<<3) /* call reentered after suspension */ +#define CIST_YPCALL (1<<4) /* call is a yieldable protected call */ +#define CIST_STAT (1<<5) /* call has an error status (pcall) */ #define curr_func(L) (clvalue(L->ci->func)) -- cgit v1.2.3-55-g6feb