diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-01-16 14:54:37 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-01-16 14:54:37 -0200 |
commit | 7e2015a46df7976bddee313b994742e49e420714 (patch) | |
tree | 0b2db30f1214a478ccb3664d165c8a431f0d5850 /ldump.c | |
parent | 5b01cb39b5ec36c544152351c35c43149d9bbfec (diff) | |
download | lua-7e2015a46df7976bddee313b994742e49e420714.tar.gz lua-7e2015a46df7976bddee313b994742e49e420714.tar.bz2 lua-7e2015a46df7976bddee313b994742e49e420714.zip |
size of short strings stored in a single byte, to reduce the size
of struct 'TString'
Diffstat (limited to 'ldump.c')
-rw-r--r-- | ldump.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldump.c,v 2.33 2014/07/18 13:36:14 roberto Exp roberto $ | 2 | ** $Id: ldump.c,v 2.34 2014/11/02 19:19:04 roberto Exp roberto $ |
3 | ** save precompiled Lua chunks | 3 | ** save precompiled Lua chunks |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -74,7 +74,7 @@ static void DumpString (const TString *s, DumpState *D) { | |||
74 | if (s == NULL) | 74 | if (s == NULL) |
75 | DumpByte(0, D); | 75 | DumpByte(0, D); |
76 | else { | 76 | else { |
77 | size_t size = s->len + 1; /* include trailing '\0' */ | 77 | size_t size = tsslen(s) + 1; /* include trailing '\0' */ |
78 | if (size < 0xFF) | 78 | if (size < 0xFF) |
79 | DumpByte(cast_int(size), D); | 79 | DumpByte(cast_int(size), D); |
80 | else { | 80 | else { |