aboutsummaryrefslogtreecommitdiff
path: root/lgc.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-05-03 10:14:25 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-05-03 10:14:25 -0300
commitb14609032cf328dea48b0803f3e585e223283b3d (patch)
tree6f59256fb668d15a17ec41feef0d01304c2a1ed6 /lgc.h
parentb36e26f51b117df98f0f5376f352c2381df3025f (diff)
downloadlua-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 'lgc.h')
-rw-r--r--lgc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lgc.h b/lgc.h
index 9ba7ecb0..b972472f 100644
--- a/lgc.h
+++ b/lgc.h
@@ -127,7 +127,7 @@
127 127
128/* 128/*
129** some gc parameters are stored divided by 4 to allow a maximum value 129** some gc parameters are stored divided by 4 to allow a maximum value
130** larger than 1000 in a 'lu_byte'. 130** up to 1023 in a 'lu_byte'.
131*/ 131*/
132#define getgcparam(p) ((p) * 4) 132#define getgcparam(p) ((p) * 4)
133#define setgcparam(p,v) ((p) = (v) / 4) 133#define setgcparam(p,v) ((p) = (v) / 4)