[gjs] closure: run a MaybeGC at the end of closures
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] closure: run a MaybeGC at the end of closures
- Date: Sun, 2 Apr 2017 03:27:23 +0000 (UTC)
commit 0e414849eae15e00f2b9cf630e703caf4c3741f8
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Thu Feb 20 13:53:42 2014 +0100
closure: run a MaybeGC at the end of closures
MaybeGC is safe to call frequently, and this follows Firefox's
idea of running the GC at the end of "scripts" (which in our
case are JS closures and ffi calls). In practice, this means
we run a MaybeGC before returning to C code, and in particular
before returning to the mainloop from sources, which is good.
https://bugzilla.gnome.org/show_bug.cgi?id=724797
gi/closure.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gi/closure.cpp b/gi/closure.cpp
index 67fb034..634ea5d 100644
--- a/gi/closure.cpp
+++ b/gi/closure.cpp
@@ -245,6 +245,8 @@ gjs_closure_invoke(GClosure *closure,
" - closure %p", closure);
}
+ JS_MaybeGC(context);
+
out:
JS_EndRequest(context);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]