/* Create or reuse a zero-terminated string, first checking in the cache (using the string address as a key). The cache can contain only zero-terminated strings, so it is safe to use 'strcmp' to check hits.  */
TString* luaS_new(lua_State *L, const char *str)
/* Create or reuse a zero-terminated string, first checking in the cache (using the string address as a key). The cache can contain only zero-terminated strings, so it is safe to use 'strcmp' to check hits.  */
TString* luaS_new(lua_State *L, const char *str)
{
    if (strcmp(str, getstr(p[j])) == 0)
      return p[j];
  }
  for (j = STRCACHE_M - 1; j > 0; j--)
    p[j] = p[j - 1];
  p[0] = luaS_newlstr(L, str, strlen(str));
  return p[0];
}