Corrected C interface for mask operation to avoid memleak

pizdaint-runs
Cirdans-Home 5 years ago
parent dbdbea9c6f
commit 93b8696df0

@ -87,7 +87,7 @@ bool psb_c_dgecmpmat_val(psb_c_dspmat *ah,psb_d_t val,psb_d_t tol,psb_c_descri
psb_i_t psb_c_dgeaddconst(psb_c_dvector *xh,psb_d_t bh,psb_c_dvector *zh,psb_c_descriptor *cdh);
psb_d_t psb_c_dgenrm2_weight(psb_c_dvector *xh,psb_c_dvector *wh,psb_c_descriptor *cdh);
psb_d_t psb_c_dgenrm2_weightmask(psb_c_dvector *xh,psb_c_dvector *wh,psb_c_dvector *idvh,psb_c_descriptor *cdh);
psb_i_t psb_c_dmask(psb_c_dvector *ch,psb_c_dvector *xh,psb_c_dvector *mh, void *t, psb_c_descriptor *cdh);
psb_i_t psb_c_dmask(psb_c_dvector *ch,psb_c_dvector *xh,psb_c_dvector *mh, bool *t, psb_c_descriptor *cdh);
psb_d_t psb_c_dgemin(psb_c_dvector *xh,psb_c_descriptor *cdh);
psb_d_t psb_c_dminquotient(psb_c_dvector *xh,psb_c_dvector *yh, psb_c_descriptor *cdh);
psb_i_t psb_c_dspscal(psb_d_t alpha, psb_c_dspmat *ah, psb_c_descriptor *cdh);

@ -87,7 +87,7 @@ bool psb_c_sgecmpmat_val(psb_c_sspmat *ah,psb_s_t val,psb_s_t tol,psb_c_descript
psb_i_t psb_c_sgeaddconst(psb_c_svector *xh,psb_s_t bh,psb_c_svector *zh,psb_c_descriptor *cdh);
psb_s_t psb_c_sgenrm2_weight(psb_c_svector *xh,psb_c_svector *wh,psb_c_descriptor *cdh);
psb_s_t psb_c_sgenrm2_weightmask(psb_c_svector *xh,psb_c_svector *wh,psb_c_svector *idvh,psb_c_descriptor *cdh);
psb_i_t psb_c_smask(psb_c_svector *ch,psb_c_svector *xh,psb_c_svector *mh, void *t, psb_c_descriptor *cdh);
psb_i_t psb_c_smask(psb_c_svector *ch,psb_c_svector *xh,psb_c_svector *mh, bool *t, psb_c_descriptor *cdh);
psb_s_t psb_c_sgemin(psb_c_svector *xh,psb_c_descriptor *cdh);
psb_i_t psb_c_sspscal(psb_s_t alpha, psb_c_sspmat *ah, psb_c_descriptor *cdh);
psb_i_t psb_c_sspscalpid(psb_s_t alpha, psb_c_sspmat *ah, psb_c_descriptor *cdh);

@ -575,12 +575,12 @@ contains
type(psb_c_dvector) :: ch,xh,mh
type(psb_c_descriptor) :: cdh
type(c_ptr), value :: t
logical(c_bool) :: t
type(psb_desc_type), pointer :: descp
type(psb_d_vect_type), pointer :: cp,xp,mp
integer(psb_c_ipk_) :: info
logical, pointer :: fp
logical :: fp
res = -1
@ -604,10 +604,10 @@ contains
else
return
end if
call c_f_pointer(t,fp)
call psb_mask(cp,xp,mp,fp,descp,info)
t = fp
res = info
end function psb_c_dmask

@ -575,12 +575,12 @@ contains
type(psb_c_svector) :: ch,xh,mh
type(psb_c_descriptor) :: cdh
type(c_ptr), value :: t
logical(c_bool) :: t
type(psb_desc_type), pointer :: descp
type(psb_s_vect_type), pointer :: cp,xp,mp
integer(psb_c_ipk_) :: info
logical, pointer :: fp
logical :: fp
res = -1
@ -604,10 +604,10 @@ contains
else
return
end if
call c_f_pointer(t,fp)
call psb_mask(cp,xp,mp,fp,descp,info)
t = fp
res = info
end function psb_c_smask

Loading…
Cancel
Save