comparison 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
comparison
equal deleted inserted replaced
59:fb97bed55789 60:e557d84318a7
124 PyErr_SetString(PyExc_NotImplementedError, 124 PyErr_SetString(PyExc_NotImplementedError,
125 "This function is not yet implemented for wide " 125 "This function is not yet implemented for wide "
126 "unicode builds of Python."); 126 "unicode builds of Python.");
127 return NULL; 127 return NULL;
128 #endif 128 #endif
129 }
130
131 static PyObject *
132 PYM_gc(PYM_JSContextObject *self, PyObject *args)
133 {
134 JS_GC(self->cx);
135 Py_RETURN_NONE;
129 } 136 }
130 137
131 static PyObject * 138 static PyObject *
132 PYM_initStandardClasses(PYM_JSContextObject *self, PyObject *args) 139 PYM_initStandardClasses(PYM_JSContextObject *self, PyObject *args)
133 { 140 {
274 {"define_property", 281 {"define_property",
275 (PyCFunction) PYM_defineProperty, METH_VARARGS, 282 (PyCFunction) PYM_defineProperty, METH_VARARGS,
276 "Defines a property on an object."}, 283 "Defines a property on an object."},
277 {"get_property", (PyCFunction) PYM_getProperty, METH_VARARGS, 284 {"get_property", (PyCFunction) PYM_getProperty, METH_VARARGS,
278 "Gets the given property for the given JavaScript object."}, 285 "Gets the given property for the given JavaScript object."},
286 {"gc", (PyCFunction) PYM_gc, METH_VARARGS,
287 "Performs garbage collection on the context's runtime."},
279 {NULL, NULL, 0, NULL} 288 {NULL, NULL, 0, NULL}
280 }; 289 };
281 290
282 PyTypeObject PYM_JSContextType = { 291 PyTypeObject PYM_JSContextType = {
283 PyObject_HEAD_INIT(NULL) 292 PyObject_HEAD_INIT(NULL)