add lua_clonefunction for lua 5.3

This commit is contained in:
Cloud Wu
2015-01-22 14:13:26 +08:00
parent 93da2dbfc9
commit b891146397
15 changed files with 246 additions and 160 deletions

View File

@@ -392,11 +392,7 @@ typedef struct LocVar {
} LocVar;
/*
** Function Prototypes
*/
typedef struct Proto {
CommonHeader;
typedef struct SharedProto {
lu_byte numparams; /* number of fixed parameters */
lu_byte is_vararg;
lu_byte maxstacksize; /* maximum stack used by this function */
@@ -408,14 +404,23 @@ typedef struct Proto {
int sizelocvars;
int linedefined;
int lastlinedefined;
TValue *k; /* constants used by the function */
void *l_G; /* global state belongs to */
Instruction *code;
struct Proto **p; /* functions defined inside the function */
int *lineinfo; /* map from opcodes to source lines (debug information) */
LocVar *locvars; /* information about local variables (debug information) */
Upvaldesc *upvalues; /* upvalue information */
struct LClosure *cache; /* last created closure with this prototype */
TString *source; /* used for debug information */
} SharedProto;
/*
** Function Prototypes
*/
typedef struct Proto {
CommonHeader;
struct SharedProto *sp;
TValue *k; /* constants used by the function */
struct Proto **p; /* functions defined inside the function */
struct LClosure *cache; /* last created closure with this prototype */
GCObject *gclist;
} Proto;