hermann on Sun, 14 Jul 2024 19:41:30 +0200


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

Re: Should forvec_t / forvec_init() / forvec_next() work in shared library code?


On 2024-07-14 19:04, Bill Allombert wrote:
Sure. Maybe you are deleting data created by forvec_init in the PARI stack that
is still in use.

Seeing your code it was likely a missing cgetg() call.

For example, this code works fine:

Thanks for that example — and yes, it works well:

$ diff bill.txt fv.c
0a1,3
#include <pari/pari.h>

int main()
1a5
    pari_init(1000000,2);
18a23,26
    pari_close();

    return 0;
}
$
$ gcc fv.c -o fv -lpari
$ ./fv
[1, 2]
[1, 3]
[1, 4]
[2, 2]
[2, 3]
[2, 4]
[3, 2]
[3, 3]
[3, 4]
$


Regards,

Hermann.