Skip to content

Commit

Permalink
Update event_loop.h
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeChampion committed Apr 11, 2024
1 parent 25d1ff2 commit f479a3c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions runtime/js-compute-runtime/core/event_loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ namespace core {
typedef bool ProcessAsyncTask(JSContext *cx, int32_t handle, JS::HandleObject context,
JS::HandleObject promise);

// 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.
// Another approach we can take is to have two queues, one contains the JSObjects for GC and another for plain data
// 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.
// Another approach we can take is to have two
// queues, one contains the JSObjects for GC
// and another for plain data
class AsyncTask final : public builtins::BuiltinNoConstructor<AsyncTask> {
public:
static constexpr const char *class_name = "AsyncTask";
Expand Down

0 comments on commit f479a3c

Please sign in to comment.