# HG changeset patch # User Atul Varma # Date 1248563421 25200 # Node ID e557d84318a713ab567939888a77e8f63633db79 # Parent fb97bed55789c100a7be06aea8d61d38de52e9a3 Added a gc() method to the context object which performs garbage collection. diff -r fb97bed55789 -r e557d84318a7 context.c --- 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} };