getsize.c

changeset 1
fcb41eb42326
parent 0
dc6c564e4d0a
equal deleted inserted replaced
0:dc6c564e4d0a 1:fcb41eb42326
17 TValue* o = L->base; 17 TValue* o = L->base;
18 switch (o->tt) { 18 switch (o->tt) {
19 /* Container types */ 19 /* Container types */
20 case LUA_TTABLE: { 20 case LUA_TTABLE: {
21 Table *h = hvalue(o); 21 Table *h = hvalue(o);
22 printf("Size of array: %p\n", h->array);
23 lua_pushinteger(L, sizeof(Table) + sizeof(TValue) * h->sizearray + 22 lua_pushinteger(L, sizeof(Table) + sizeof(TValue) * h->sizearray +
24 sizeof(Node) * sizenode(h)); 23 sizeof(Node) * sizenode(h));
25 break; 24 break;
26 } 25 }
27 case LUA_TFUNCTION: { 26 case LUA_TFUNCTION: {

mercurial