Add a dedicated OP_LUSH A B instruction that loads shell C functions directly from the registry, eliminating the need for upvalue allocation in mainfunc(), upvalue population in lua_load(), and the fragile LUSH_NUM_UPVALS heuristic. Every chunk no longer carries 4 extra upvalues.
25 lines
528 B
C
25 lines
528 B
C
/*
|
|
** $Id: lcmd.h $
|
|
** Command execution for backtick syntax
|
|
** See Copyright Notice in lua.h
|
|
*/
|
|
|
|
#ifndef lcmd_h
|
|
#define lcmd_h
|
|
|
|
#include "lua.h"
|
|
|
|
/* OP_LUSH sub-operation indices (B operand selects which function) */
|
|
#define LUSH_OP_COMMAND 0
|
|
#define LUSH_OP_INTERACTIVE 1
|
|
#define LUSH_OP_GETENV 2
|
|
#define LUSH_OP_SETENV 3
|
|
#define LUSH_OP_COUNT 4
|
|
|
|
int lushCmd_command (lua_State *L);
|
|
int lushCmd_interactive (lua_State *L);
|
|
int lushCmd_getenv (lua_State *L);
|
|
int lushCmd_setenv (lua_State *L);
|
|
|
|
#endif
|