diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-11-15 12:04:53 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-11-15 12:04:53 -0300 |
commit | a4762b6ffe74f5878882ef238d37bfa92d90e418 (patch) | |
tree | 4f52a82641838a318e6270522d9e7f83ccab388d /ltable.c | |
parent | d4247befa18a7911c56e7110154ad73574cd6648 (diff) | |
download | lua-a4762b6ffe74f5878882ef238d37bfa92d90e418.tar.gz lua-a4762b6ffe74f5878882ef238d37bfa92d90e418.tar.bz2 lua-a4762b6ffe74f5878882ef238d37bfa92d90e418.zip |
'objsize' returns 'l_mem'
Sums of size_t may not fit in a size_t.
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -863,8 +863,9 @@ Table *luaH_new (lua_State *L) { | |||
863 | } | 863 | } |
864 | 864 | ||
865 | 865 | ||
866 | size_t luaH_size (Table *t) { | 866 | lu_mem luaH_size (Table *t) { |
867 | size_t sz = sizeof(Table) + luaH_realasize(t) * (sizeof(Value) + 1); | 867 | lu_mem sz = cast(lu_mem, sizeof(Table)) |
868 | + luaH_realasize(t) * (sizeof(Value) + 1); | ||
868 | if (!isdummy(t)) | 869 | if (!isdummy(t)) |
869 | sz += sizehash(t); | 870 | sz += sizehash(t); |
870 | return sz; | 871 | return sz; |