|
From: Ethan A M. <merritt@u.washington.edu> - 2006-05-29 15:27:56
|
On Monday 29 May 2006 04:06 am, Hans-Bernhard Br=F6ker wrote: >=20 > The problem is in 'reset': that command is not supposed to as much as=20 > *look* at the user-defined variables in the first place, much less=20 > remove any of them, whether they're in limbo or not. It only removes undefined variables. This is only garbage-collection mechanism we have for such space, so if you remove it we will end up with the opposite problem of a memory leak. The issue is that the parsing code uses add_udv(), which results in=20 space allocation for every variable mentioned, whether or not it is a correctly defined variable. For example: print nonsense allocates space for a variable "nonsense" before reporting that it is undefined. This space will only be released if you later define "nonsense" properly, or do a reset.=20 > gnuplot> f(x) =3D x+a > gnuplot> g(x) =3D x+b > gnuplot> plot f(x) > undefined variable: a I am inclined to say that the definition of f(x) should fail if there=20 is no previously-defined variable 'a'. Alternatively, the code that creates an evaluation stack for 'f(x)' could initialize a to 0 rather than leaving it undefined. =2D-=20 Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |