forked from GitHub/gf-core
the statistical parser is now using two memory pools: one for parsing and one for the output trees. This means that the memory for parsing can be released as soon as the needed abstract trees are retrieved, while the trees themselves are retained in the separate output pool
This commit is contained in:
@@ -124,7 +124,7 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
GuReader *rdr = gu_string_reader(gu_str_string(line, ppool), ppool);
|
||||
PgfLexer *lexer = pgf_new_simple_lexer(rdr, ppool);
|
||||
GuEnum* result = pgf_parse(concr, cat, lexer, ppool);
|
||||
GuEnum* result = pgf_parse(concr, cat, lexer, ppool, ppool);
|
||||
|
||||
PgfExprProb* ep = NULL;
|
||||
if (result != NULL)
|
||||
|
||||
@@ -335,7 +335,7 @@ int main ()
|
||||
pgf_new_simple_lexer(rdr, ppool);
|
||||
|
||||
GuEnum* result =
|
||||
pgf_parse(from_concr, cat, lexer, ppool);
|
||||
pgf_parse(from_concr, cat, lexer, ppool, ppool);
|
||||
if (result == NULL) {
|
||||
FCGI_printf("Status: 500 Internal Server Error\r\n");
|
||||
FCGI_printf("Content-type: text/plain\r\n"
|
||||
|
||||
@@ -169,7 +169,7 @@ int main(int argc, char* argv[]) {
|
||||
clock_t start = clock();
|
||||
|
||||
result =
|
||||
pgf_parse(from_concr, cat, lexer, ppool);
|
||||
pgf_parse(from_concr, cat, lexer, ppool, ppool);
|
||||
if (result == NULL) {
|
||||
PgfToken tok =
|
||||
pgf_lexer_current_token(lexer);
|
||||
|
||||
Reference in New Issue
Block a user