mirror of
https://github.com/lua/lua
synced 2026-09-26 16:17:11 +03:00
Added suport for Fixed Buffers
A fixed buffer keeps a binary chunk "forever", so that the program does not need to copy some of its parts when loading it.
This commit is contained in:
parent
f33cda8d6e
commit
14e416355f
12 changed files with 160 additions and 34 deletions
|
|
@ -207,8 +207,8 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) {
|
|||
list = &tb->hash[lmod(h, tb->size)]; /* rehash with new size */
|
||||
}
|
||||
ts = createstrobj(L, l, LUA_VSHRSTR, h);
|
||||
memcpy(getshrstr(ts), str, l * sizeof(char));
|
||||
ts->shrlen = cast_byte(l);
|
||||
memcpy(getshrstr(ts), str, l * sizeof(char));
|
||||
ts->u.hnext = *list;
|
||||
*list = ts;
|
||||
tb->nuse++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue