diff context.c @ 60:e557d84318a7

Added a gc() method to the context object which performs garbage collection.
author Atul Varma <varmaa@toolness.com>
date Sat, 25 Jul 2009 16:10:21 -0700
parents bc4263c6ae82
children fb7e11dec538
line wrap: on
line diff
--- a/context.c	Sun Jul 19 20:27:25 2009 -0700
+++ b/context.c	Sat Jul 25 16:10:21 2009 -0700
@@ -129,6 +129,13 @@
 }
 
 static PyObject *
+PYM_gc(PYM_JSContextObject *self, PyObject *args)
+{
+  JS_GC(self->cx);
+  Py_RETURN_NONE;
+}
+
+static PyObject *
 PYM_initStandardClasses(PYM_JSContextObject *self, PyObject *args)
 {
   PYM_JSObject *object;
@@ -276,6 +283,8 @@
    "Defines a property on an object."},
   {"get_property", (PyCFunction) PYM_getProperty, METH_VARARGS,
    "Gets the given property for the given JavaScript object."},
+  {"gc", (PyCFunction) PYM_gc, METH_VARARGS,
+   "Performs garbage collection on the context's runtime."},
   {NULL, NULL, 0, NULL}
 };