X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=check%2Fparser_memleak.cpp;h=ffe095dfc6ddaa90afdede398f460d95afa93249;hb=9431fba22d0523bba51a0fc3e488627594af0884;hp=d1d4bccd35716d7e3095377ff301bea5bf66c19a;hpb=789b6b908fadc1139e9bc1a4611cc957ad11579b;p=ginac.git diff --git a/check/parser_memleak.cpp b/check/parser_memleak.cpp index d1d4bccd..ffe095df 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-2019 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[] = { "x²+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;