Skip to content

Commit 5fe8340

Browse files
Oleksandr Motsakmohamed-barakat
authored andcommitted
FIX: libpolys and kernel should use rDelete instead of rKill!
1 parent 737a681 commit 5fe8340

File tree

10 files changed

+24
-23
lines changed

10 files changed

+24
-23
lines changed

kernel/ideals.cc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ ideal idSectWithElim (ideal h1,ideal h2)
280280
idDelete(&h);
281281
res=idrMoveR(res,r,origRing);
282282
rChangeCurrRing(origRing);
283-
rKill(r);
283+
rDelete(r);
284284
return res;
285285
}
286286
/*2
@@ -400,7 +400,7 @@ ideal idSect (ideal h1,ideal h2)
400400
rChangeCurrRing(syz_ring);
401401
idDelete(&temp1);
402402
rChangeCurrRing(orig_ring);
403-
rKill(syz_ring);
403+
rDelete(syz_ring);
404404
}
405405
else
406406
{
@@ -529,7 +529,7 @@ ideal idMultSect(resolvente arg, int length)
529529
if(syz_ring!=orig_ring)
530530
{
531531
rChangeCurrRing(orig_ring);
532-
rKill(syz_ring);
532+
rDelete(syz_ring);
533533
}
534534
idSkipZeroes(result);
535535
return result;
@@ -707,7 +707,7 @@ ideal idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp,
707707
s_h3->rank -= k;
708708
rChangeCurrRing(orig_ring);
709709
s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
710-
rKill(syz_ring);
710+
rDelete(syz_ring);
711711
#ifdef HAVE_PLURAL
712712
if (rIsPluralRing(currRing))
713713
{
@@ -765,7 +765,7 @@ ideal idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp,
765765
if (dp_C_ring != syz_ring)
766766
{
767767
rChangeCurrRing(syz_ring);
768-
rKill(dp_C_ring);
768+
rDelete(dp_C_ring);
769769
}
770770
}
771771
else
@@ -818,7 +818,7 @@ ideal idXXX (ideal h1, int k)
818818
idSkipZeroes(s_h3);
819819
rChangeCurrRing(orig_ring);
820820
s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
821-
rKill(syz_ring);
821+
rDelete(syz_ring);
822822
idTest(s_h3);
823823
return s_h3;
824824
}
@@ -981,7 +981,7 @@ ideal idLiftStd (ideal h1, matrix* ma, tHomog hi, ideal * syz)
981981
}
982982
}
983983

984-
if (syz_ring!=orig_ring) rKill(syz_ring);
984+
if (syz_ring!=orig_ring) rDelete(syz_ring);
985985
verbose = save_verbose;
986986
return s_h3;
987987
}
@@ -1184,7 +1184,7 @@ ideal idLift(ideal mod, ideal submod,ideal *rest, BOOLEAN goodShape,
11841184
rChangeCurrRing(orig_ring);
11851185
s_result = idrMoveR_NoSort(s_result, syz_ring, orig_ring);
11861186
s_rest = idrMoveR_NoSort(s_rest, syz_ring, orig_ring);
1187-
rKill(syz_ring);
1187+
rDelete(syz_ring);
11881188
}
11891189
if (rest!=NULL)
11901190
*rest = s_rest;
@@ -1488,7 +1488,7 @@ ideal idQuot (ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN resultIsIdeal)
14881488
{
14891489
rChangeCurrRing(orig_ring);
14901490
s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
1491-
rKill(syz_ring);
1491+
rDelete(syz_ring);
14921492
}
14931493
idSkipZeroes(s_h3);
14941494
idTest(s_h3);
@@ -2092,7 +2092,7 @@ static ideal idHandleIdealOp(ideal arg,int syzcomp,int isIdeal=FALSE)
20922092
rChangeCurrRing(syz_ring);
20932093
idDelete(&s_temp1);
20942094
rChangeCurrRing(orig_ring);
2095-
rKill(syz_ring);
2095+
rDelete(syz_ring);
20962096
}
20972097
20982098
for (i=0;i<IDELEMS(temp1);i++)
@@ -2235,7 +2235,7 @@ ideal idModulo (ideal h2,ideal h1, tHomog hom, intvec ** w)
22352235
{
22362236
rChangeCurrRing(orig_ring);
22372237
s_temp1 = idrMoveR_NoSort(s_temp1, syz_ring, orig_ring);
2238-
rKill(syz_ring);
2238+
rDelete(syz_ring);
22392239
// Hmm ... here seems to be a memory leak
22402240
// However, simply deleting it causes memory trouble
22412241
// idDelete(&s_temp);

kernel/nc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ ideal Approx_Step(ideal L)
358358
rChangeCurrRing(orig_ring);
359359
// s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
360360
s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
361-
rKill(syz_ring);
361+
rDelete(syz_ring);
362362
}
363363
idTest(s_h3);
364364
S[syzcnt]=kStd(s_h3,currQuotient,(tHomog)FALSE,NULL,NULL);

kernel/preimage.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ ideal maGetPreimage(ring theImageRing, map theMap, ideal id, const ring dst_r)
165165
}
166166
id_Delete(&temp2, tmpR);
167167
idSkipZeroes(temp1);
168-
rKill(tmpR);
168+
rDelete(tmpR);
169169
return temp1;
170170
}
171171

kernel/syz.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ resolvente syResolvente(ideal arg, int maxlength, int * length,
610610
{
611611
res[i] = idrMoveR_NoSort(res[i], syz_ring, origR);
612612
}
613-
rKill(syz_ring);
613+
rDelete(syz_ring);
614614
}
615615
return res;
616616
}

kernel/syz0.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ resolvente sySchreyerResolvente(ideal arg, int maxlength, int * length,
975975
syzIndex++;
976976
}
977977
// j = 0; while (currRing->order[j]!=0) j++; // What was this for???!
978-
rKill(syRing);
978+
rDelete(syRing);
979979
}
980980
else
981981
{

kernel/syz1.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ void syKillComputation(syStrategy syzstr, ring r)
16461646
if(syzstr->syRing->typ[1].ord_typ == ro_syzcomp)
16471647
rChangeSComps(NULL, NULL, 0, syzstr->syRing);
16481648

1649-
rKill(syzstr->syRing);
1649+
rDelete(syzstr->syRing);
16501650
}
16511651
omFreeSize((ADDRESS)syzstr, sizeof(ssyStrategy));
16521652
}

kernel/syz3.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ syStrategy syKosz(ideal arg,int * length)
18911891
omFreeSize((ADDRESS)res,len*sizeof(ideal));
18921892
idDelete(&initial);
18931893
rChangeCurrRing(syzstr->syRing);
1894-
rKill(dp_C_ring);
1894+
rDelete(dp_C_ring);
18951895
}
18961896
#endif
18971897
#endif
@@ -2021,7 +2021,7 @@ syStrategy syKosz(ideal arg,int * length)
20212021
}
20222022
delete syzstr->Tl;
20232023
syzstr->Tl = NULL;
2024-
rKill(syzstr->syRing);
2024+
rDelete(syzstr->syRing);
20252025
syzstr->syRing = NULL;
20262026
omFreeSize((ADDRESS)totake,(*length+1)*sizeof(ideal));
20272027
omFreeSize((ADDRESS)syzstr->orderedRes,(*length+1)*sizeof(ideal));

kernel/tgb.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3611,7 +3611,7 @@ ideal t_rep_gb (ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
36113611

36123612
idTest (result);
36133613
//rChangeCurrRing(new_ring);
3614-
rKill (new_ring);
3614+
rDelete(new_ring);
36153615
//rChangeCurrRing(orig_ring);
36163616
}
36173617
else

kernel/walkMain.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ WalkState walkStep64(ideal & G,int64vec* currw64, int step){
184184
//PrintS(" lift for initial forms done\n");
185185

186186
ideal nextG=idrMoveR(G,oldRing,currRing);
187-
rKill(oldRing);
187+
rDelete(oldRing);
188188

189189
matrix nextGmat=(matrix)nextG;
190190

libpolys/polys/monomials/ring.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ ring rDefault(const coeffs cf, int N, char **n,int ord_size, int *ord, int *bl
344344
// #define rIsRingVar(A) r_IsRingVar(A,currRing)
345345
int r_IsRingVar(const char *n, ring r);
346346
void rWrite(ring r);
347-
//void rKill(idhdl h);
348-
void rKill(ring r);
347+
// void rKill(idhdl h);
348+
// void rKill(ring r);
349349
ring rCopy(ring r);
350350
ring rCopy0(const ring r, BOOLEAN copy_qideal = TRUE, BOOLEAN copy_ordering = TRUE);
351351
ring rCopy0AndAddA(ring r, int64vec *wv64, BOOLEAN copy_qideal = TRUE,
@@ -740,7 +740,8 @@ BOOLEAN rSetISReference(const ring r, const ideal F, const int i = 0, const int
740740

741741
BOOLEAN rCheckIV(intvec *iv);
742742
int rTypeOfMatrixOrder(intvec * order);
743-
void rDelete(ring r);
743+
744+
void rDelete(ring r); // To be used instead of rKill!
744745

745746
extern omBin sip_sring_bin;
746747
#endif

0 commit comments

Comments
 (0)