richardhundt / lua-marshal Goto Github PK
View Code? Open in Web Editor NEWfast table serialization for Lua
fast table serialization for Lua
Hi, I'm working on merging this tool to Lua53. And I found https://github.com/richardhundt/lua-marshal/blob/master/test.lua#L64 failed because print is C function. Does it suppose to work or fail?
A nil upvalue makes lua_objlen stop counting leaving following upvalues nil as well
instead explicitly store ar.nups when the table is created
lmarshal.c#L224
lua_newtable(L);
for (i=1; i <= ar.nups; i++) {
lua_getupvalue(L, -2, i);
lua_rawseti(L, -2, i);
}
should become
lua_createtable(L, ar.nups, 1);
lua_pushinteger(L, ar.nups);
lua_setfield(L, -2, "nups");
for (i=1; i <= ar.nups; i++) {
lua_getupvalue(L, -2, i);
lua_rawseti(L, -2, i);
}
lmarshal.c#L389
mar_decode_table(L, *p, l, idx);
nups = lua_objlen(L, -1);
for (i=1; i <= nups; i++) {
lua_rawgeti(L, -1, i);
lua_setupvalue(L, -3, i);
}
should become
mar_decode_table(L, ld_lpf, field.v_len, idx);
lua_getfield(L, -1, "nups");
nups = lua_tointeger(L, -1);
lua_pop(L, 1);
for (i=1; i <= nups; i++) {
lua_rawgeti(L, -1, i);
lua_setupvalue(L, -3, i);
}
What kind of license is this based?
What is allowed with this code?
The same way that a 'seen' table is used for shared references, upvalues shared by closures could be detected using lua_upvalueid and later their linkage restored using lua_upvaluejoin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.