diff options
Diffstat (limited to 'ltable.c')
| -rw-r--r-- | ltable.c | 5 |
1 files changed, 4 insertions, 1 deletions
| @@ -278,10 +278,12 @@ LUAI_FUNC unsigned int luaH_realasize (const Table *t) { | |||
| 278 | size |= (size >> 2); | 278 | size |= (size >> 2); |
| 279 | size |= (size >> 4); | 279 | size |= (size >> 4); |
| 280 | size |= (size >> 8); | 280 | size |= (size >> 8); |
| 281 | #if (UINT_MAX >> 14) > 3 /* unsigned int has more than 16 bits */ | ||
| 281 | size |= (size >> 16); | 282 | size |= (size >> 16); |
| 282 | #if (UINT_MAX >> 30) > 3 | 283 | #if (UINT_MAX >> 30) > 3 |
| 283 | size |= (size >> 32); /* unsigned int has more than 32 bits */ | 284 | size |= (size >> 32); /* unsigned int has more than 32 bits */ |
| 284 | #endif | 285 | #endif |
| 286 | #endif | ||
| 285 | size++; | 287 | size++; |
| 286 | lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size); | 288 | lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size); |
| 287 | return size; | 289 | return size; |
| @@ -710,7 +712,8 @@ static Node *getfreepos (Table *t) { | |||
| 710 | ** put new key in its main position; otherwise (colliding node is in its main | 712 | ** put new key in its main position; otherwise (colliding node is in its main |
| 711 | ** position), new key goes to an empty position. | 713 | ** position), new key goes to an empty position. |
| 712 | */ | 714 | */ |
| 713 | void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value) { | 715 | static void luaH_newkey (lua_State *L, Table *t, const TValue *key, |
| 716 | TValue *value) { | ||
| 714 | Node *mp; | 717 | Node *mp; |
| 715 | TValue aux; | 718 | TValue aux; |
| 716 | if (l_unlikely(ttisnil(key))) | 719 | if (l_unlikely(ttisnil(key))) |
