1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-15 23:07:14 +00:00

Add proto field to tables to allow prototypal inheritance.

This commit is contained in:
Calvin Rose
2018-03-10 13:34:46 -05:00
parent 0c3b0673ff
commit 0b6ac1698c
10 changed files with 71 additions and 39 deletions

View File

@@ -109,10 +109,15 @@ static void dst_mark_array(DstArray *array) {
}
static void dst_mark_table(DstTable *table) {
recur: /* Manual tail recursion */
if (dst_gc_reachable(table))
return;
dst_gc_mark(table);
dst_mark_kvs(table->data, table->capacity);
if (table->proto) {
table = table->proto;
goto recur;
}
}
static void dst_mark_struct(const DstKV *st) {