Ramón Casero Cañas on Sat, 18 Jan 2003 20:49:54 +0100 (MET)

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: how to free pari's memory

Karim BELABAS wrote:

>On Thu, 16 Jan 2003, Ramón Casero Cañas wrote:

>Anyway, if you want to use PARI, then remove it completely [ not a good
>if you do this more than once : it involves a very significant overhead ],
>you have to do it by hand:
>  void freeall(void);
>  void pari_sig_init(void (*f)(int));
>  freeall();
>  if (INIT_SIG) pari_sig_init(SIG_DFL);

Um, I don't know whether I have undestood you completely. Do you mean that I
have to add the to first declarations at the beginning of the file where the
function with PARI is used, and then just copy & paste the other two before
the return of the function? So freeall() and pari_sig_init() are both
compiled in the library, but there's no declaration included from "pari.h", aren't

>None of the above is documented (it's the first time the problem of
>the library is raised...)

Man, am I a pioneer!  :-)

>>But I have noticed that if I press CTRL-C while the program is
>>running (after returning from the function), I get a
>>  ***   user interrupt.
>>  ***   Error in the PARI system. End of program.
>>Is there a way to delete the stack. I suposse this is not a garbage
>Not related to stack. PARI traps a number of signals for its own use, and
>want to restore default behaviour. Either use SIG_DFL as above, or
>re-initialize your own signal handler [ no way to recover the one PARI
>replaced using PARI functions, I'm afraid ]

I'm with Bill in that it would be nice to be able to use the PARI system as
a secondary system, like most libraries allow. But it's just an idea.



+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!