Skip to content

Commit 25d1ff2

Browse files
committed
Update event_loop.h
1 parent 02184fd commit 25d1ff2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

runtime/js-compute-runtime/core/event_loop.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ namespace core {
1616
typedef bool ProcessAsyncTask(JSContext *cx, int32_t handle, JS::HandleObject context,
1717
JS::HandleObject promise);
1818

19+
// AsyncTask is a JSObject so that we can store other JSObjects inside it, and once the AsyncTask has completed and is erased from the async task queues then the JSObjects it contains will be available to be garbage collected.
20+
// Another approach we can take is to have two queues, one contains the JSObjects for GC and another for plain data
1921
class AsyncTask final : public builtins::BuiltinNoConstructor<AsyncTask> {
2022
public:
2123
static constexpr const char *class_name = "AsyncTask";

0 commit comments

Comments
 (0)