diff --git a/include/gc/modules.h b/include/gc/modules.h index f5d53ac..71f08ef 100644 --- a/include/gc/modules.h +++ b/include/gc/modules.h @@ -21,6 +21,7 @@ void gc_mark_esm(ant_t *js, gc_mark_fn mark); void gc_mark_worker_threads(ant_t *js, gc_mark_fn mark); void gc_mark_abort(ant_t *js, gc_mark_fn mark); void gc_mark_domexception(ant_t *js, gc_mark_fn mark); +void gc_mark_queuing_strategies(ant_t *js, gc_mark_fn mark); void gc_mark_readable_streams(ant_t *js, gc_mark_fn mark); void gc_mark_writable_streams(ant_t *js, gc_mark_fn mark); diff --git a/include/streams/queuing.h b/include/streams/queuing.h index dd399c5..e88efc1 100644 --- a/include/streams/queuing.h +++ b/include/streams/queuing.h @@ -1,6 +1,9 @@ #ifndef STREAMS_QUEUING_H #define STREAMS_QUEUING_H +#include "types.h" + void init_queuing_strategies_module(void); +void gc_mark_queuing_strategies(ant_t *js, void (*mark)(ant_t *, ant_value_t)); #endif diff --git a/src/gc/objects.c b/src/gc/objects.c index 07efe3a..a05b665 100644 --- a/src/gc/objects.c +++ b/src/gc/objects.c @@ -454,6 +454,7 @@ static void gc_mark_roots(ant_t *js) { gc_mark_worker_threads(js, gc_mark_value); gc_mark_abort(js, gc_mark_value); gc_mark_domexception(js, gc_mark_value); + gc_mark_queuing_strategies(js, gc_mark_value); gc_mark_readable_streams(js, gc_mark_value); gc_mark_writable_streams(js, gc_mark_value); @@ -754,4 +755,4 @@ void gc_objects_run_minor(ant_t *js, gc_str_mark_fn str_mark) { uint64_t gc_get_epoch(void) { return gc_epoch; -} \ No newline at end of file +} diff --git a/src/streams/queuing.c b/src/streams/queuing.c index ee22242..04dceed 100644 --- a/src/streams/queuing.c +++ b/src/streams/queuing.c @@ -109,3 +109,8 @@ void init_queuing_strategies_module(void) { js_set(js, g, "ByteLengthQueuingStrategy", blqs_ctor); js_set_descriptor(js, g, "ByteLengthQueuingStrategy", 25, JS_DESC_W | JS_DESC_C); } + +void gc_mark_queuing_strategies(ant_t *js, void (*mark)(ant_t *, ant_value_t)) { + mark(js, g_count_qs_proto); + mark(js, g_bytelength_qs_proto); +}