diff options
Diffstat (limited to 'ltable.h')
-rw-r--r-- | ltable.h | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.h,v 2.20 2014/09/04 18:15:29 roberto Exp roberto $ | 2 | ** $Id: ltable.h,v 2.21 2015/11/03 15:47:30 roberto Exp roberto $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -27,6 +27,14 @@ | |||
27 | #define invalidateTMcache(t) ((t)->flags = 0) | 27 | #define invalidateTMcache(t) ((t)->flags = 0) |
28 | 28 | ||
29 | 29 | ||
30 | /* true when 't' is using 'dummynode' as its hash part */ | ||
31 | #define isdummy(t) ((t)->lastfree == NULL) | ||
32 | |||
33 | |||
34 | /* allocated size for hash nodes */ | ||
35 | #define allocsizenode(t) (isdummy(t) ? 0 : sizenode(t)) | ||
36 | |||
37 | |||
30 | /* returns the key, given the value of a table entry */ | 38 | /* returns the key, given the value of a table entry */ |
31 | #define keyfromval(v) \ | 39 | #define keyfromval(v) \ |
32 | (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val)))) | 40 | (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val)))) |
@@ -51,7 +59,7 @@ LUAI_FUNC int luaH_getn (Table *t); | |||
51 | 59 | ||
52 | #if defined(LUA_DEBUG) | 60 | #if defined(LUA_DEBUG) |
53 | LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); | 61 | LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); |
54 | LUAI_FUNC int luaH_isdummy (Node *n); | 62 | LUAI_FUNC int luaH_isdummy (const Table *t); |
55 | #endif | 63 | #endif |
56 | 64 | ||
57 | 65 | ||