> - for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL;
> + memset(g->mt, 0, sizeof(struct Table *) * (size_t) LUA_NUMTAGS);
No. The C standard says that NULL does not need to have all bits zero.
Change 0 by NULL, after the memset, the memory has the same content.
- for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL;
+ memset(g->mt, NULL, sizeof(struct Table *) * (size_t) LUA_NUMTAGS);
Internally, memset has its own loop, but this is very highly optimized for the platform used.
regards,
Ranier Vilela