Mercurial > pymonkey
changeset 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 | fb97bed55789 |
children | 1506350991d4 |
files | context.c |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
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} };