MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaH_realasize

Function luaH_realasize

extlibs/lua/src/ltable.c:209–227  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

207** Returns the real size of the 'array' array
208*/
209LUAI_FUNC unsigned int luaH_realasize (const Table *t) {
210 if (limitequalsasize(t))
211 return t->alimit; /* this is the size */
212 else {
213 unsigned int size = t->alimit;
214 /* compute the smallest power of 2 not smaller than 'n' */
215 size |= (size >> 1);
216 size |= (size >> 2);
217 size |= (size >> 4);
218 size |= (size >> 8);
219 size |= (size >> 16);
220#if (UINT_MAX >> 30) > 3
221 size |= (size >> 32); /* unsigned int has more than 32 bits */
222#endif
223 size++;
224 lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size);
225 return size;
226 }
227}
228
229
230/*

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