summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2011-09-16 10:28:16 -0400
committerColin Walters <walters@verbum.org>2011-09-16 16:58:32 -0400
commit059f6a13bb5ed18060aa27bbe900575e6966efb0 (patch)
treedbb32825b990ffaf3adc9b681dbfeeb6ebf6b491
parent72bc4307860a315f9d2173d700582add938d79a0 (diff)
downloadgjs-GJS_1_29_18.tar.gz
context: Add gjs_context_gc() wrapperGJS_1_29_18
Simple wrapper for JS_GC() avoids simple embedders having to drop to JSAPI. https://bugzilla.gnome.org/show_bug.cgi?id=659253
-rw-r--r--gjs/context.c13
-rw-r--r--gjs/context.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/gjs/context.c b/gjs/context.c
index 5688477f..bb7a4cd3 100644
--- a/gjs/context.c
+++ b/gjs/context.c
@@ -899,6 +899,19 @@ gjs_context_maybe_gc (GjsContext *context)
gjs_maybe_gc(context->context);
}
+/**
+ * gjs_context_gc:
+ * @context: a #GjsContext
+ *
+ * Initiate a full GC; may or may not block until complete. This
+ * function just calls Spidermonkey JS_GC().
+ */
+void
+gjs_context_gc (GjsContext *context)
+{
+ JS_GC(context->context);
+}
+
static gboolean
gjs_context_idle_emit_gc (gpointer data)
{
diff --git a/gjs/context.h b/gjs/context.h
index 3fc94e07..4e01cc78 100644
--- a/gjs/context.h
+++ b/gjs/context.h
@@ -75,6 +75,8 @@ void gjs_context_print_stack_stderr (GjsContext *js_context);
void gjs_context_maybe_gc (GjsContext *context);
+void gjs_context_gc (GjsContext *context);
+
void gjs_dumpstack (void);
G_END_DECLS