diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-03 10:14:25 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-03 10:14:25 -0300 |
| commit | b14609032cf328dea48b0803f3e585e223283b3d (patch) | |
| tree | 6f59256fb668d15a17ec41feef0d01304c2a1ed6 /llimits.h | |
| parent | b36e26f51b117df98f0f5376f352c2381df3025f (diff) | |
| download | lua-b14609032cf328dea48b0803f3e585e223283b3d.tar.gz lua-b14609032cf328dea48b0803f3e585e223283b3d.tar.bz2 lua-b14609032cf328dea48b0803f3e585e223283b3d.zip | |
Avoid the creation of too many strings in 'package'
Both when setting a path and searching for a file ('searchpath'),
this commit reduces the number of intermediate strings created
in Lua.
(For setting a path the change is not relevant, because this is
done only twice when loading the module. Anyway, it is a nice example
of how to use auxlib buffers to manipulate strings in the C API.)
Diffstat (limited to 'llimits.h')
| -rw-r--r-- | llimits.h | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -39,7 +39,7 @@ typedef signed char ls_byte; | |||
| 39 | /* maximum value for size_t */ | 39 | /* maximum value for size_t */ |
| 40 | #define MAX_SIZET ((size_t)(~(size_t)0)) | 40 | #define MAX_SIZET ((size_t)(~(size_t)0)) |
| 41 | 41 | ||
| 42 | /* maximum size visible for Lua (must be representable in a lua_Integer */ | 42 | /* maximum size visible for Lua (must be representable in a lua_Integer) */ |
| 43 | #define MAX_SIZE (sizeof(size_t) < sizeof(lua_Integer) ? MAX_SIZET \ | 43 | #define MAX_SIZE (sizeof(size_t) < sizeof(lua_Integer) ? MAX_SIZET \ |
| 44 | : (size_t)(LUA_MAXINTEGER)) | 44 | : (size_t)(LUA_MAXINTEGER)) |
| 45 | 45 | ||
