X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fparser_memleak.cpp;h=b0000331768ef47883ba17faac5ed917156d41f0;hp=ebc6ed9f59a750584aa7de0e88b7627738bfcdc8;hb=7d2c44606a17c76f6bec520c22eba96fa5875961;hpb=86fe62b1f98e61167e0f1012ff078a2f1547458f diff --git a/check/parser_memleak.cpp b/check/parser_memleak.cpp index ebc6ed9f..b0000331 100644 --- a/check/parser_memleak.cpp +++ b/check/parser_memleak.cpp @@ -1,24 +1,45 @@ -/** - * This small program exhibits the memory leak in the ginac_yylex(). - * Run it as +/** @file parser_memleak.cpp * - * valgrind --leak-check=yes ./parser_memleak + * This small program exhibits the memory leak in the ginac_yylex(). + * Run it as * - * or simply + * valgrind --leak-check=yes ./parser_memleak * - * ulimit -v `expr 64 \* 1024` ./parser_memleak + * or simply + * + * ulimit -v `expr 64 \* 1024` ./parser_memleak + */ + +/* + * GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include +using namespace GiNaC; + #include #include -#include using namespace std; -using namespace GiNaC; int main(int argc, char** argv) { const symbol x("x"), y("y"); const lst syms(x, y); // parser-generated symbol => memory leak. - static const char* str[] = { "x2+2*x*y + cos(x)", "Li2(x/y) + log(y/x)" }; + static const char* str[] = { "x^2+2*x*y + cos(x)", "Li2(x/y) + log(y/x)" }; // depends on the amount of the available VM, compiler options, etc. const unsigned N_max = 500000;