mirror of https://github.com/rusefi/lua.git
fitting a StackValue structure into 32 bytes (for 64-bit machines)
This commit is contained in:
parent
93fd67b793
commit
5a3f26f855
17
lobject.h
17
lobject.h
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lobject.h,v 2.127 2017/11/03 12:12:30 roberto Exp roberto $
|
** $Id: lobject.h,v 2.128 2017/11/03 17:22:54 roberto Exp roberto $
|
||||||
** Type definitions for Lua objects
|
** Type definitions for Lua objects
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -314,26 +314,27 @@ typedef union StackValue {
|
||||||
struct {
|
struct {
|
||||||
TValuefields;
|
TValuefields;
|
||||||
lu_byte callstatus_;
|
lu_byte callstatus_;
|
||||||
short nresults; /* expected number of results from this function */
|
char nresults; /* expected number of results from this function */
|
||||||
|
union {
|
||||||
|
unsigned char funcidx; /* called-function index */
|
||||||
|
unsigned char nyield; /* number of values yielded */
|
||||||
|
} u2;
|
||||||
unsigned short previous; /* difference to previous 'func' */
|
unsigned short previous; /* difference to previous 'func' */
|
||||||
unsigned short framesize; /* stack space available for this function */
|
unsigned short framesize; /* stack space available for this function */
|
||||||
union {
|
|
||||||
unsigned short funcidx; /* called-function index */
|
|
||||||
unsigned short nyield; /* number of values yielded */
|
|
||||||
} u2;
|
|
||||||
union {
|
union {
|
||||||
struct { /* only for Lua functions */
|
struct { /* only for Lua functions */
|
||||||
const Instruction *savedpc;
|
const Instruction *savedpc;
|
||||||
} l;
|
} l;
|
||||||
struct { /* only for C functions */
|
struct { /* only for C functions */
|
||||||
lua_KFunction k; /* continuation in case of yields */
|
lua_KFunction k; /* continuation in case of yields */
|
||||||
ptrdiff_t old_errfunc;
|
int old_errfunc;
|
||||||
lua_KContext ctx; /* context info. in case of yields */
|
int ctx; /* context info. in case of yields */
|
||||||
} c;
|
} c;
|
||||||
} u;
|
} u;
|
||||||
} stkci;
|
} stkci;
|
||||||
} StackValue;
|
} StackValue;
|
||||||
|
|
||||||
|
|
||||||
#define callstatus(ar) ((ar)->stkci.callstatus_)
|
#define callstatus(ar) ((ar)->stkci.callstatus_)
|
||||||
|
|
||||||
/* top of a function (first element after its frame) */
|
/* top of a function (first element after its frame) */
|
||||||
|
|
Loading…
Reference in New Issue