memory leak when constructing expression from a string
16 Nov
2007
16 Nov
'07
12:40 p.m.
Hello! This silly program #include <iostream> #include <stdexcept> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main(int argc, char** argv) { ex e; const symbol x("x"), y("y"); const lst syms(x, y); static const char* str[] = { "x^2+2*x*y + cos(x)", "Li2(x/y) + log(y/x)" }; unsigned N=0; try { for (; ; N++) { e = ex(str[N & 1], syms); } } catch (...) { cerr << "N = " << N << endl; return 1; } return 0; } exhausts all the available memory. I don't think this is correct behaviour. Any suggestions how to fix this? Best regards, Alexei -- All science is either physics or stamp collecting.
6435
Age (days ago)
6435
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexei Sheplyakov