aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-03-10 11:17:51 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-03-10 11:17:51 -0300
commitb66fedadaef9b6adcdc531d96eb0c4e54a600f6b (patch)
tree227c7b220b14f258ba436d0da3d9c07d0b5d4def
parentfd6e680e2161ea4511c395edddc84de2134fcb93 (diff)
downloadlua-b66fedadaef9b6adcdc531d96eb0c4e54a600f6b.tar.gz
lua-b66fedadaef9b6adcdc531d96eb0c4e54a600f6b.tar.bz2
lua-b66fedadaef9b6adcdc531d96eb0c4e54a600f6b.zip
'lua_pushliteral' implemented with 'lua_pushstring' (to take
advantage of the cache)
-rw-r--r--lua.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/lua.h b/lua.h
index 28dbe092..ad54f432 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.325 2014/12/26 17:24:27 roberto Exp roberto $ 2** $Id: lua.h,v 1.326 2015/01/13 19:50:30 roberto Exp roberto $
3** Lua - A Scripting Language 3** Lua - A Scripting Language
4** Lua.org, PUC-Rio, Brazil (http://www.lua.org) 4** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
5** See Copyright Notice at the end of this file 5** See Copyright Notice at the end of this file
@@ -358,8 +358,7 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
358#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE) 358#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE)
359#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0) 359#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0)
360 360
361#define lua_pushliteral(L, s) \ 361#define lua_pushliteral(L, s) lua_pushstring(L, "" s)
362 lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1)
363 362
364#define lua_pushglobaltable(L) \ 363#define lua_pushglobaltable(L) \
365 lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS) 364 lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS)