Changeset 879e4c in git


Ignore:
Timestamp:
Oct 15, 2015, 3:47:11 PM (8 years ago)
Author:
Adi Popescu <adi_popescum@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
2d265b2596f3ebb9c7b09c216ebe2faa2638f2d5
Parents:
5fd2b1e537aec892b174f98c27dc1c56397fcba2
Message:
memory still leaks
Location:
kernel/GBEngine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kstd1.cc

    r5fd2b1e r879e4c  
    415415      // over ZZ: cleanup coefficients by complete reduction with monomials
    416416      postReduceByMon(h, strat);
    417       if(nIsZero(pGetCoeff(h->p)) || h->p == NULL) return 2;
     417      if(h->p == NULL)
     418      {
     419        if (h->lcm!=NULL) pLmDelete(h->lcm);
     420        h->Clear();
     421        return 0;
     422      }
    418423      if(strat->tl >= 0)
    419424          h->i_r1 = strat->tl;
     
    12001205      if (pLmCmp(strat->L[i].p,strat->kNoether) == -1)
    12011206      {
    1202         pLmFree(strat->L[i].p);
     1207        #ifdef HAVE_RINGS
     1208        if (rField_is_Ring(currRing))
     1209          pLmDelete(strat->L[i].p);
     1210        else
     1211        #endif
     1212          pLmFree(strat->L[i].p);
    12031213        strat->L[i].p = NULL;
    12041214      }
    12051215      else
    12061216      {
    1207         pLmFree(strat->L[i].p);
     1217        #ifdef HAVE_RINGS
     1218        if (rField_is_Ring(currRing))
     1219          pLmDelete(strat->L[i].p);
     1220        else
     1221        #endif
     1222          pLmFree(strat->L[i].p);
    12081223        strat->L[i].p = NULL;
    12091224        poly m1 = NULL, m2 = NULL;
  • kernel/GBEngine/kutil.cc

    r5fd2b1e r879e4c  
    375375          pSetCoeff(L->p,eins);
    376376          if (L->t_p != NULL)
    377             pSetCoeff0(L->t_p,eins);
     377            pSetCoeff(L->t_p,eins);
    378378        }
    379379        else
     
    13971397    }
    13981398  #else
    1399   assume(i<=strat->sl);
    14001399  assume(atR >= 0);
    14011400  assume(i<=strat->sl);
     1401  assume(p!=NULL);
    14021402  int      l,j,compare,compareCoeff;
    14031403  LObject  h;
     
    15441544  #endif
    15451545  number s, t;
    1546   poly m1, m2, gcd;
     1546  poly m1, m2, gcd = NULL;
    15471547  #if ADIDEBUG
    15481548  printf("\nTrying to add spair S[%i] und p\n",i);pWrite(strat->S[i]);pWrite(p);
     
    15541554  pSetCoeff0(m1, s);
    15551555  pSetCoeff0(m2, t);
    1556   pNeg(m2);
     1556  m2 = pNeg(m2);
    15571557  p_Test(m1,strat->tailRing);
    15581558  p_Test(m2,strat->tailRing);
     
    15631563  if(sim2 == NULL)
    15641564  {
     1565    pDelete(&m1);
     1566    pDelete(&m2);
    15651567    if(pm1 == NULL)
    15661568    {
    1567       //pDelete(&sim2);
    1568       //pDelete(&pm1);
    1569       //pDelete(&gcd);
    1570       //pDelete(&m1);
    1571       //pDelete(&m2);
    15721569      return;
    15731570    }
    15741571    else
    15751572    {
    1576       gcd = pCopy(pm1);
    1577       pDelete(&pm1);
    1578       pDelete(&sim2);
    1579       pDelete(&m1);
    1580       pDelete(&m2);
     1573      gcd = pm1;
     1574      pm1 = NULL;
    15811575    }
    15821576  }
     
    23712365    pDelete(&pSigMult);
    23722366    pDelete(&sSigMult);
    2373     pLmFree(Lp.lcm);
     2367    #ifdef HAVE_RINGS
     2368    if (rField_is_Ring(currRing))
     2369      pLmDelete(Lp.lcm);
     2370    else
     2371    #endif
     2372      pLmFree(Lp.lcm);
    23742373    Lp.lcm=NULL;
    23752374    pDelete (&m1);
     
    23872386    pDelete(&pSigMult);
    23882387    pDelete(&sSigMult);
    2389     pLmFree(Lp.lcm);
     2388    #ifdef HAVE_RINGS
     2389    if (rField_is_Ring(currRing))
     2390      pLmDelete(Lp.lcm);
     2391    else
     2392    #endif
     2393      pLmFree(Lp.lcm);
    23902394    Lp.lcm=NULL;
    23912395    pDelete (&m1);
     
    91009104    return TRUE;
    91019105  }
    9102   pLmFree(newNoether);
     9106  #ifdef HAVE_RINGS
     9107  if (rField_is_Ring(currRing))
     9108    pLmDelete(newNoether);
     9109  else
     9110  #endif
     9111    pLmFree(newNoether);
    91039112  return FALSE;
    91049113}
     
    93599368        if(pLmDivisibleBy(strat->S[i], p))
    93609369        {
    9361           p->coef = currRing->cf->cfIntMod(p->coef, strat->S[i]->coef, currRing->cf);
     9370          number dummy = n_IntMod(p->coef, strat->S[i]->coef, currRing->cf);
     9371          p_SetCoeff(p,dummy,currRing);
    93629372        }
    93639373        if(nIsZero(p->coef))
    93649374        {
    9365           pLmDelete(&pNext(p));
     9375          pLmDelete(&p);
    93669376          deleted = TRUE;
    93679377        }
     
    93769386        if(pLmDivisibleBy(strat->S[i], pp))
    93779387        {
    9378           pp->coef = currRing->cf->cfIntMod(pp->coef, strat->S[i]->coef, currRing->cf);
     9388          number dummy = n_IntMod(pp->coef, strat->S[i]->coef, currRing->cf);
     9389          p_SetCoeff(pp,dummy,currRing);
    93799390          if(nIsZero(pp->coef))
    93809391          {
     
    94239434          if(pLmDivisibleBy(strat->S[j], p))
    94249435          {
    9425             //nDelete(&(p->coef));
    9426             p->coef = currRing->cf->cfIntMod(p->coef, strat->S[j]->coef, currRing->cf);
     9436            number dummy = n_IntMod(p->coef, strat->S[j]->coef, currRing->cf);
     9437            p_SetCoeff(p,dummy,currRing);
    94279438          }
    94289439          pp = pNext(p);
     
    94379448                if(pLmDivisibleBy(strat->S[j], pp))
    94389449                {
    9439                   //nDelete(&(pp->coef));
    9440                   pp->coef = currRing->cf->cfIntMod(pp->coef, strat->S[j]->coef, currRing->cf);
     9450                  number dummy = n_IntMod(pp->coef, strat->S[j]->coef, currRing->cf);
     9451                  p_SetCoeff(pp,dummy,currRing);
    94419452                  if(nIsZero(pp->coef))
    94429453                  {
Note: See TracChangeset for help on using the changeset viewer.