String buffers, part 2d: basic string buffer methods.

Sponsored by fmad.io.
This commit is contained in:
Mike Pall
2021-06-01 05:16:32 +02:00
parent edd5cbadc5
commit a119497bec
18 changed files with 816 additions and 85 deletions

View File

@@ -65,6 +65,12 @@ static void gc_mark(global_State *g, GCobj *o)
gray2black(o); /* Userdata are never gray. */
if (mt) gc_markobj(g, mt);
gc_markobj(g, tabref(gco2ud(o)->env));
if (LJ_HASBUFFER && gco2ud(o)->udtype == UDTYPE_BUFFER) {
SBufExt *sbx = (SBufExt *)uddata(gco2ud(o));
if (sbufiscow(sbx) && gcref(sbx->cowref) != NULL) {
gc_markobj(g, gcref(sbx->cowref));
}
}
} else if (LJ_UNLIKELY(gct == ~LJ_TUPVAL)) {
GCupval *uv = gco2uv(o);
gc_marktv(g, uvval(uv));