On Monday, September 2, 2024 at 11:13:43 AM UTC-6 dima wrote:

It appears that all these gunclone_deep() etc aren't documented in any 
proper way (and this is a root cause of this; same applies to memleaks we 
have in libsingular interface). Can you post a link to docs you are reading?
I can only find an email exchange from 2018 where 
similar issues are discussed.
It seems that gunclone_deep should be used sparingly.


Just a small addendum to this thread.  The recommended way to deal with 
freeing elements of a "lazy vector" GEN -- recommended in both the email 
exchange in the the PARI documentation  -- is to pass the GEN to obj_free.  
But if you look at the code you find that what obj_free does is to first 
verify that the last element in the GEN is a t_VEC and, if so, pass it to 
gunclone_deep.

So, while the libpari documentation (section 5.6.2) says that gunclone_deep 
is only useful in the context of the GP interpreter, in fact they use it in 
obj_free within libpari itself.. 

"User's Guide to the PARI library 

void gunclone_deep(GEN x) is only useful in the context of the GP 
interpreter which may replace arbitrary components of container types (t_VEC, 
t_COL, t_MAT, t_LIST) by clones. If x is such a container, the function 
recursively deletes all clones among the components of x, then unclones x. 
Useless in library mode: simply use gunclone."

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/eb10b1b6-dfee-4ab6-a879-f74e87572af3n%40googlegroups.com.

Reply via email to