| 553 | |
| 554 | |
| 555 | LUA_API const char *lua_pushexternalstring (lua_State *L, |
| 556 | const char *s, size_t len, lua_Alloc falloc, void *ud) { |
| 557 | TString *ts; |
| 558 | lua_lock(L); |
| 559 | api_check(L, len <= MAX_SIZE, "string too large"); |
| 560 | api_check(L, s[len] == '\0', "string not ending with zero"); |
| 561 | ts = luaS_newextlstr (L, s, len, falloc, ud); |
| 562 | setsvalue2s(L, L->top.p, ts); |
| 563 | api_incr_top(L); |
| 564 | luaC_checkGC(L); |
| 565 | lua_unlock(L); |
| 566 | return getstr(ts); |
| 567 | } |
| 568 | |
| 569 | |
| 570 | LUA_API const char *lua_pushstring (lua_State *L, const char *s) { |
no test coverage detected