mirror of
https://github.com/lua/lua.git
synced 2025-02-04 06:13:04 +08:00
new option 'p' for 'debug.sizeof' (size of a pointer)
This commit is contained in:
parent
7f1a2ad699
commit
e401513086
5
ldblib.c
5
ldblib.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ldblib.c,v 1.139 2014/05/15 19:27:33 roberto Exp roberto $
|
** $Id: ldblib.c,v 1.140 2014/08/21 19:12:40 roberto Exp roberto $
|
||||||
** Interface from Lua to its debug API
|
** Interface from Lua to its debug API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -33,7 +33,8 @@ static int db_Csize (lua_State *L) {
|
|||||||
{'l', sizeof(long)},
|
{'l', sizeof(long)},
|
||||||
{'z', sizeof(size_t)},
|
{'z', sizeof(size_t)},
|
||||||
{'f', sizeof(float)},
|
{'f', sizeof(float)},
|
||||||
{'d', sizeof(double)}
|
{'d', sizeof(double)},
|
||||||
|
{'p', sizeof(void*)}
|
||||||
};
|
};
|
||||||
const char *s = luaL_checkstring(L, 1);
|
const char *s = luaL_checkstring(L, 1);
|
||||||
int i;
|
int i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user