MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaH_realasize

Function luaH_realasize

3rd/lua-5.4.3/src/ltable.c:241–259  ·  view source on GitHub ↗

** Returns the real size of the 'array' array */

Source from the content-addressed store, hash-verified

239** Returns the real size of the 'array' array
240*/
241LUAI_FUNC unsigned int luaH_realasize (const Table *t) {
242 if (limitequalsasize(t))
243 return t->alimit; /* this is the size */
244 else {
245 unsigned int size = t->alimit;
246 /* compute the smallest power of 2 not smaller than 'n' */
247 size |= (size >> 1);
248 size |= (size >> 2);
249 size |= (size >> 4);
250 size |= (size >> 8);
251 size |= (size >> 16);
252#if (UINT_MAX >> 30) > 3
253 size |= (size >> 32); /* unsigned int has more than 32 bits */
254#endif
255 size++;
256 lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size);
257 return size;
258 }
259}
260
261
262/*

Callers 9

luaV_executeFunction · 0.85
setlimittosizeFunction · 0.85
luaH_nextFunction · 0.85
luaH_freeFunction · 0.85
luaH_getintFunction · 0.85
luaH_getnFunction · 0.85
traverseephemeronFunction · 0.85
traversestrongtableFunction · 0.85
clearbyvaluesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected