@@ -489,7 +489,7 @@ LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) {
489489LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) {
490490 TString *ts;
491491 lua_lock (L);
492- ts = (len == 0 ) ? luaS_new (L, " " ) : luaS_newlstr (L, s, len);
492+ ts = (len == 0 ) ? TString::create (L, " " ) : TString::create (L, s, len);
493493 setsvalue2s (L, L->getTop ().p , ts);
494494 api_incr_top (L);
495495 luaC_checkGC (L);
@@ -504,7 +504,7 @@ LUA_API const char *lua_pushexternalstring (lua_State *L,
504504 lua_lock (L);
505505 api_check (L, len <= MAX_SIZE, " string too large" );
506506 api_check (L, s[len] == ' \0 ' , " string not ending with zero" );
507- ts = luaS_newextlstr (L, s, len, falloc, ud);
507+ ts = TString::createExternal (L, s, len, falloc, ud);
508508 setsvalue2s (L, L->getTop ().p , ts);
509509 api_incr_top (L);
510510 luaC_checkGC (L);
@@ -519,7 +519,7 @@ LUA_API const char *lua_pushstring (lua_State *L, const char *s) {
519519 setnilvalue (s2v (L->getTop ().p ));
520520 else {
521521 TString *ts;
522- ts = luaS_new (L, s);
522+ ts = TString::create (L, s);
523523 setsvalue2s (L, L->getTop ().p , ts);
524524 s = getstr (ts); /* internal copy's address */
525525 }
@@ -613,7 +613,7 @@ LUA_API int lua_pushthread (lua_State *L) {
613613
614614static int auxgetstr (lua_State *L, const TValue *t, const char *k) {
615615 lu_byte tag;
616- TString *str = luaS_new (L, k);
616+ TString *str = TString::create (L, k);
617617 tag = luaV_fastget (t, str, s2v (L->getTop ().p ), luaH_getstr);
618618 if (!tagisempty (tag))
619619 api_incr_top (L);
@@ -794,7 +794,7 @@ LUA_API int lua_getiuservalue (lua_State *L, int idx, int n) {
794794*/
795795static void auxsetstr (lua_State *L, const TValue *t, const char *k) {
796796 int hres;
797- TString *str = luaS_new (L, k);
797+ TString *str = TString::create (L, k);
798798 api_checkpop (L, 1 );
799799 hres = luaV_fastset (t, str, s2v (L->getTop ().p - 1 ), luaH_psetstr);
800800 if (hres == HOK) {
@@ -1225,7 +1225,7 @@ LUA_API void lua_concat (lua_State *L, int n) {
12251225 luaC_checkGC (L);
12261226 }
12271227 else { /* nothing to concatenate */
1228- setsvalue2s (L, L->getTop ().p , luaS_newlstr (L, " " , 0 )); /* push empty string */
1228+ setsvalue2s (L, L->getTop ().p , TString::create (L, " " , 0 )); /* push empty string */
12291229 api_incr_top (L);
12301230 }
12311231 lua_unlock (L);
0 commit comments