From b3680b60258372baa1d5e606026760ef223641b9 Mon Sep 17 00:00:00 2001 From: krasimir Date: Fri, 3 Jul 2015 11:53:52 +0000 Subject: merge the states for reasoning and evaluation into a single structure --- src/runtime/python/pypgf.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/runtime/python') diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c index cd4d2d26d..6fea65fd1 100644 --- a/src/runtime/python/pypgf.c +++ b/src/runtime/python/pypgf.c @@ -2484,24 +2484,26 @@ PGF_generateAll(PGFObject* self, PyObject *args, PyObject *keywds) pyres->source = (PyObject*) self; Py_INCREF(self); + GuPool* out_pool = gu_new_pool(); + + PyObject* py_pool = PyPool_New(out_pool); + pyres->container = PyTuple_Pack(2, pyres->source, py_pool); + Py_DECREF(py_pool); + pyres->pool = gu_new_pool(); pyres->max_count = max_count; pyres->counter = 0; pyres->fetch = Iter_fetch_expr; - pyres->container = (PyObject*) pyres; - GuPool *tmp_pool = gu_local_pool(); + GuExn* err = gu_exn(pyres->pool); pyres->res = - pgf_generate_all(self->pgf, catname, pyres->pool); + pgf_generate_all(self->pgf, catname, err, pyres->pool, out_pool); if (pyres->res == NULL) { Py_DECREF(pyres); - gu_pool_free(tmp_pool); return NULL; } - gu_pool_free(tmp_pool); - return pyres; } -- cgit v1.2.3