diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-06 15:34:06 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-06 15:34:06 -0200 |
commit | 5a3f26f85558bedfa439027919d928abfdd00b6d (patch) | |
tree | 27364777af93cfaa5b7b60208394eb1d63725f5b | |
parent | 93fd67b7936f0f1fc20645d18eb85a193887c315 (diff) | |
download | lua-5a3f26f85558bedfa439027919d928abfdd00b6d.tar.gz lua-5a3f26f85558bedfa439027919d928abfdd00b6d.tar.bz2 lua-5a3f26f85558bedfa439027919d928abfdd00b6d.zip |
fitting a StackValue structure into 32 bytes (for 64-bit machines)
-rw-r--r-- | lobject.h | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 2.127 2017/11/03 12:12:30 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.128 2017/11/03 17:22:54 roberto Exp roberto $ |
3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -314,26 +314,27 @@ typedef union StackValue { | |||
314 | struct { | 314 | struct { |
315 | TValuefields; | 315 | TValuefields; |
316 | lu_byte callstatus_; | 316 | lu_byte callstatus_; |
317 | short nresults; /* expected number of results from this function */ | 317 | char nresults; /* expected number of results from this function */ |
318 | unsigned short previous; /* difference to previous 'func' */ | ||
319 | unsigned short framesize; /* stack space available for this function */ | ||
320 | union { | 318 | union { |
321 | unsigned short funcidx; /* called-function index */ | 319 | unsigned char funcidx; /* called-function index */ |
322 | unsigned short nyield; /* number of values yielded */ | 320 | unsigned char nyield; /* number of values yielded */ |
323 | } u2; | 321 | } u2; |
322 | unsigned short previous; /* difference to previous 'func' */ | ||
323 | unsigned short framesize; /* stack space available for this function */ | ||
324 | union { | 324 | union { |
325 | struct { /* only for Lua functions */ | 325 | struct { /* only for Lua functions */ |
326 | const Instruction *savedpc; | 326 | const Instruction *savedpc; |
327 | } l; | 327 | } l; |
328 | struct { /* only for C functions */ | 328 | struct { /* only for C functions */ |
329 | lua_KFunction k; /* continuation in case of yields */ | 329 | lua_KFunction k; /* continuation in case of yields */ |
330 | ptrdiff_t old_errfunc; | 330 | int old_errfunc; |
331 | lua_KContext ctx; /* context info. in case of yields */ | 331 | int ctx; /* context info. in case of yields */ |
332 | } c; | 332 | } c; |
333 | } u; | 333 | } u; |
334 | } stkci; | 334 | } stkci; |
335 | } StackValue; | 335 | } StackValue; |
336 | 336 | ||
337 | |||
337 | #define callstatus(ar) ((ar)->stkci.callstatus_) | 338 | #define callstatus(ar) ((ar)->stkci.callstatus_) |
338 | 339 | ||
339 | /* top of a function (first element after its frame) */ | 340 | /* top of a function (first element after its frame) */ |