diff options
| author | 2022-10-18 09:12:03 +0200 | |
|---|---|---|
| committer | 2022-10-18 09:12:03 +0200 | |
| commit | 6047f56db82852f07e4f7e308af69fa80b1cc259 (patch) | |
| tree | 25b8332e1f6e1502728831000f5756fb72aafdb1 /pez.c | |
| parent | 3e917f496591dc476281eafdebcc92d0a923bd12 (diff) | |
gc mark record
Diffstat (limited to 'pez.c')
| -rw-r--r-- | pez.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -951,6 +951,19 @@ markdilambda(PezContext *cx, Dilambda *dl) } static void +markrecord(PezContext *cx, Record *rc) +{ + for (uint i = 0; i < (1 << rc->exp); ++i) { + if (isobj(rc->dat[i].k)) { + gcmark(cx, unbox_obj(rc->dat[i].k)); + } + if (isobj(rc->dat[i].v)) { + gcmark(cx, unbox_obj(rc->dat[i].v)); + } + } +} + +static void gcmark(PezContext *cx, Obj *o) { assert(cx->gccanrun); @@ -974,6 +987,9 @@ gcmark(PezContext *cx, Obj *o) case PEZ_TDilambda: markdilambda(cx, (Dilambda *)o); break; + case PEZ_TRecord: + markrecord(cx, (Record *)o); + break; } } |