String buffers, part 1: object serialization.

Sponsored by fmad.io.
This commit is contained in:
Mike Pall
2021-03-25 02:21:31 +01:00
parent 836fb5bbd3
commit 4c6b669c41
26 changed files with 797 additions and 18 deletions

View File

@@ -743,6 +743,9 @@ LUALIB_API int luaopen_string(lua_State *L)
setgcref(basemt_it(g, LJ_TSTR), obj2gco(mt));
settabV(L, lj_tab_setstr(L, mt, mmname_str(g, MM_index)), tabV(L->top-1));
mt->nomm = (uint8_t)(~(1u<<MM_index));
#if LJ_HASBUFFER
lj_lib_prereg(L, LUA_STRLIBNAME ".buffer", luaopen_string_buffer, tabV(L->top-1));
#endif
return 1;
}