Added field 'srclen' to structure 'lua_Debug'

This new field gets the length of 'source' in the same structure.
Unlike the other strings in that structure, 'source' can be
relatively large, and Lua already has its length readily available.
This commit is contained in:
Roberto Ierusalimschy
2019-04-04 11:45:26 -03:00
parent 38425e0692
commit 5ca1075b71
6 changed files with 31 additions and 20 deletions

1
lua.h
View File

@@ -469,6 +469,7 @@ struct lua_Debug {
const char *namewhat; /* (n) 'global', 'local', 'field', 'method' */
const char *what; /* (S) 'Lua', 'C', 'main', 'tail' */
const char *source; /* (S) */
size_t srclen; /* (S) */
int currentline; /* (l) */
int linedefined; /* (S) */
int lastlinedefined; /* (S) */