Changeset b15cf85 in git


Ignore:
Timestamp:
Dec 12, 2012, 10:19:10 AM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
31d8dc47fbf92b0720715abf728f23bfb49965bb
Parents:
14e634edb64741be0fbc04c9c89e8523cb0c1cc5
git-author:
Martin Lee <martinlee84@web.de>2012-12-12 10:19:10+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-12-12 15:53:48+01:00
Message:
fix: memory leak

Conflicts:

	factory/canonicalform.h
Location:
factory
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • factory/FLINTconvert.cc

    r14e634 rb15cf85  
    5757  {
    5858    mpz_t gmp_val;
    59     gmp_val[0]= *getmpi(f.getval());
     59    f.mpzval(gmp_val);
    6060    fmpz_set_mpz (result, gmp_val);
    6161    mpz_clear (gmp_val);
  • factory/NTLconvert.cc

    r14e634 rb15cf85  
    670670    char* stringtemp;
    671671
    672     gmp_val[0]=*getmpi(f.getval());
     672    f.mpzval (gmp_val);
    673673    int l=mpz_sizeinbase(gmp_val,10)+2;
    674674    stringtemp=(char*)Alloc(l);
  • factory/canonicalform.cc

    r14e634 rb15cf85  
    6868    else
    6969        return CanonicalForm( value->deepCopyObject() );
     70}
     71
     72void
     73CanonicalForm::mpzval(mpz_t val) const
     74{
     75    ASSERT (!is_imm (value) && value->levelcoeff() == IntegerDomain, "non-immediate integer expected");
     76    getmpi (value, val);
    7077}
    7178//}}}
  • factory/canonicalform.h

    r14e634 rb15cf85  
    2020#include "cf_defs.h"
    2121#include "variable.h"
     22#include <factory/cf_gmp.h>
    2223#include <factory/templates/ftmpl_list.h>
    2324#include <factory/templates/ftmpl_array.h>
     
    8081    CanonicalForm deepCopy() const;
    8182
     83    void mpzval(mpz_t val) const;
    8284    // predicates
    8385    CF_NO_INLINE bool isOne() const;
  • factory/cf_factory.cc

    r14e634 rb15cf85  
    283283    return dummy;
    284284}
     285
     286void getmpi ( InternalCF * value, mpz_t mpi)
     287{
     288    ASSERT( ! is_imm( value ) && (value->levelcoeff() == IntegerDomain ), "illegal operation" );
     289    mpz_init_set (mpi, ((InternalInteger*)value)->thempi);
     290}
     291
  • factory/cf_factory.h

    r14e634 rb15cf85  
    3535
    3636mpz_ptr getmpi ( InternalCF * value, bool symmetric = true );
     37void getmpi ( InternalCF * value, mpz_t mpi);
    3738
    3839#endif /* ! INCL_CF_FACTORY_H */
  • factory/int_int.h

    r14e634 rb15cf85  
    126126    friend void gmp_denominator ( const CanonicalForm & f, mpz_ptr result );
    127127    friend mpz_ptr getmpi ( InternalCF * value, bool symmetric );
     128    friend void getmpi ( InternalCF * value, mpz_t mpi);
    128129};
    129130
Note: See TracChangeset for help on using the changeset viewer.