diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-02 09:28:56 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-02 09:28:56 -0200 |
| commit | ba36180fd7b68341ad57e0fbe7a55cdfb334908d (patch) | |
| tree | c99f2d1335c90aad7015475e64cecbea889cefcc /lstate.h | |
| parent | b9e76be8a691ed83a716a85c6b85cb80f66cc480 (diff) | |
| download | lua-ba36180fd7b68341ad57e0fbe7a55cdfb334908d.tar.gz lua-ba36180fd7b68341ad57e0fbe7a55cdfb334908d.tar.bz2 lua-ba36180fd7b68341ad57e0fbe7a55cdfb334908d.zip | |
new API for 'lua_resume' + cleaning the uses of the 'extra' field in
'CallInfo'
Diffstat (limited to 'lstate.h')
| -rw-r--r-- | lstate.h | 13 |
1 files changed, 5 insertions, 8 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstate.h,v 2.144 2017/07/27 13:50:16 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.145 2017/10/31 17:54:35 roberto Exp roberto $ |
| 3 | ** Global State | 3 | ** Global State |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -83,12 +83,6 @@ typedef struct stringtable { | |||
| 83 | 83 | ||
| 84 | /* | 84 | /* |
| 85 | ** Information about a call. | 85 | ** Information about a call. |
| 86 | ** When a thread yields, 'func' is adjusted to pretend that the | ||
| 87 | ** top function has only the yielded values in its stack; in that | ||
| 88 | ** case, the actual 'func' value is saved in field 'extra'. | ||
| 89 | ** When a function calls another with a continuation, 'extra' keeps | ||
| 90 | ** the function index so that, in case of errors, the continuation | ||
| 91 | ** function can be called with the correct top. | ||
| 92 | */ | 86 | */ |
| 93 | typedef struct CallInfo { | 87 | typedef struct CallInfo { |
| 94 | StkId func; /* function index in the stack */ | 88 | StkId func; /* function index in the stack */ |
| @@ -104,7 +98,10 @@ typedef struct CallInfo { | |||
| 104 | lua_KContext ctx; /* context info. in case of yields */ | 98 | lua_KContext ctx; /* context info. in case of yields */ |
| 105 | } c; | 99 | } c; |
| 106 | } u; | 100 | } u; |
| 107 | ptrdiff_t extra; | 101 | union { |
| 102 | ptrdiff_t funcidx; /* called-function index */ | ||
| 103 | int nyield; /* number of values yielded */ | ||
| 104 | } u2; | ||
| 108 | short nresults; /* expected number of results from this function */ | 105 | short nresults; /* expected number of results from this function */ |
| 109 | unsigned short callstatus; | 106 | unsigned short callstatus; |
| 110 | } CallInfo; | 107 | } CallInfo; |
