forked from GitHub/gf-core
merge the states for reasoning and evaluation into a single structure
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user