G__usermemfunc_setup does not work for destructors

The CINT function G__usermemfunc_setup(…) does not fill the user parameter to the correct slot for destructor functions. This is because the destructor gets assigned to slot 0 and the filling is done before this decision is taken.
Could this be fixed? Meanwhile I have a workaround taken from Markus Frank to correct the wrong assignment in this particular case.


As far as I remember, G__usermemfunc_setup takes care of the reserved destructor position. If there is a problem, it must come from other cause. I did not understand your comment enough, because destructor does not have any parameters but you mentioned parameter is not positioned right. ??? Will you teach me more about what is going on?

Thank you
Masa Goto

In the implementation of G__usermemfunc_setup(…) in newlink.c, I can see the following likes:

G__p_ifunc->userparam[G__p_ifunc->allifunc] = userparam;
return G__memfunc_setup(funcname,hash,funcp,type,tagnum,typenum,reftype,

In case of destructors the “userparam” is occupying the slot given by G__p_ifunc->allifunc (which is the next free one I think) while the actual destructor function information is occupying the slot 0, which is decided inside G__memfunc_setup(…)

Is that more clear?


Thank you for your clarification. It is clear now.

Masa Goto