Add rust_task::gc(size_t args) method that drops us back into the GC glue.
This commit is contained in:
@@ -26,6 +26,11 @@ rust_crate::get_unwind_glue() const {
|
|||||||
return ((uintptr_t)this + unwind_glue_off);
|
return ((uintptr_t)this + unwind_glue_off);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uintptr_t
|
||||||
|
rust_crate::get_gc_glue() const {
|
||||||
|
return ((uintptr_t)this + gc_glue_off);
|
||||||
|
}
|
||||||
|
|
||||||
uintptr_t
|
uintptr_t
|
||||||
rust_crate::get_yield_glue() const {
|
rust_crate::get_yield_glue() const {
|
||||||
return ((uintptr_t)this + yield_glue_off);
|
return ((uintptr_t)this + yield_glue_off);
|
||||||
|
|||||||
@@ -660,6 +660,9 @@ rust_task : public rc_base<rust_task>,
|
|||||||
// Fail self, assuming caller-on-stack is this task.
|
// Fail self, assuming caller-on-stack is this task.
|
||||||
void fail(size_t nargs);
|
void fail(size_t nargs);
|
||||||
|
|
||||||
|
// Run the gc glue on the task stack.
|
||||||
|
void gc(size_t nargs);
|
||||||
|
|
||||||
// Notify tasks waiting for us that we are about to die.
|
// Notify tasks waiting for us that we are about to die.
|
||||||
void notify_waiting_tasks();
|
void notify_waiting_tasks();
|
||||||
|
|
||||||
|
|||||||
@@ -345,6 +345,14 @@ rust_task::fail(size_t nargs) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
rust_task::gc(size_t nargs)
|
||||||
|
{
|
||||||
|
dom->log(rust_log::TASK|rust_log::MEM,
|
||||||
|
"task 0x%" PRIxPTR " garbage collecting", this);
|
||||||
|
run_after_return(nargs, dom->root_crate->get_gc_glue());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rust_task::notify_waiting_tasks()
|
rust_task::notify_waiting_tasks()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user