Changeset aad4e14 in git


Ignore:
Timestamp:
Nov 11, 2010, 12:18:07 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
24fd7045c041f0c1ce23de9358433e0667a8228d
Parents:
a80025e8d85c97a2cc2a6b86ef219a392df4f2b5
Message:
memory management and SI_DONT_HAVE_GLOBAL_VARS


git-svn-id: file:///usr/local/Singular/svn/trunk@13633 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/interpolation.cc

    ra80025e raad4e14  
    311311     temp=(mon_list_entry*)omAlloc0(sizeof(mon_list_entry));
    312312     (*temp).next=curptr;
    313      (*temp).mon=(exponent*)omAlloc0(sizeof(exponent)*variables);
     313     (*temp).mon=(exponent*)omAlloc(sizeof(exponent)*variables);
    314314     memcpy(temp->mon,mon,sizeof(exponent)*variables);
    315315     if (prevptr==NULL) return temp;
     
    333333     mono_type m;
    334334     m=(exponent*)omAlloc0(sizeof(exponent)*variables);
    335      int i;
    336      for (i=0;i<variables;i++) m[i]=0;
    337335     return m;
    338336}
     
    341339{
    342340     int i,j,k;
    343      points=(coordinates*)omAlloc0(sizeof(coordinates)*n_points);
     341     points=(coordinates*)omAlloc(sizeof(coordinates)*n_points);
    344342     for (i=0;i<n_points;i++)
    345343     {
    346          points[i]=(coordinate_products*)omAlloc0(sizeof(coordinate_products)*variables);
     344         points[i]=(coordinate_products*)omAlloc(sizeof(coordinate_products)*variables);
    347345         for (j=0;j<variables;j++) points[i][j]=(modp_number*)omAlloc0(sizeof(modp_number)*(max_coord));
    348346     }
    349347     condition_list=(condition_type*)omAlloc0(sizeof(condition_type)*final_base_dim);
    350348     for (i=0;i<final_base_dim;i++) condition_list[i].mon=(exponent*)omAlloc0(sizeof(exponent)*variables);
    351      modp_points=(modp_coordinates*)omAlloc0(sizeof(modp_coordinates)*n_points);
     349     modp_points=(modp_coordinates*)omAlloc(sizeof(modp_coordinates)*n_points);
    352350     for (i=0;i<n_points;i++) modp_points[i]=(modp_number*)omAlloc0(sizeof(modp_number)*variables);
    353351     if (!only_modp)
     
    356354        for (i=0;i<n_points;i++)
    357355        {
    358             q_points[i]=(mpq_t*)omAlloc0(sizeof(mpq_t)*variables);
     356            q_points[i]=(mpq_t*)omAlloc(sizeof(mpq_t)*variables);
    359357            for (j=0;j<variables;j++) mpq_init(q_points[i][j]);
    360358        }
     
    362360        for (i=0;i<n_points;i++)
    363361        {
    364             int_points[i]=(mpz_t*)omAlloc0(sizeof(mpz_t)*variables);
     362            int_points[i]=(mpz_t*)omAlloc(sizeof(mpz_t)*variables);
    365363            for (j=0;j<variables;j++) mpz_init(int_points[i][j]);
    366364        }
    367365     }
    368      coord_exist=(coord_exist_table*)omAlloc0(sizeof(coord_exist_table)*n_points);
     366     coord_exist=(coord_exist_table*)omAlloc(sizeof(coord_exist_table)*n_points);
    369367     for (i=0;i<n_points;i++)
    370368     {
    371369         coord_exist[i]=(bool*)omAlloc0(sizeof(bool)*variables);
    372          for (j=0;j<variables;j++) coord_exist[i][j]=false;
    373      }
    374      generic_column_name=(mono_type*)omAlloc0(sizeof(mono_type)*final_base_dim);
     370     }
     371     generic_column_name=(mono_type*)omAlloc(sizeof(mono_type)*final_base_dim);
    375372     for (i=0;i<final_base_dim;i++) generic_column_name[i]=ZeroMonomial ();
    376373     good_primes=0;
     
    379376     if (!only_modp)
    380377     {
    381         polycoef=(mpz_t*)omAlloc0(sizeof(mpz_t)*(final_base_dim+1));
    382         polyexp=(mono_type*)omAlloc0(sizeof(mono_type)*(final_base_dim+1));
     378        polycoef=(mpz_t*)omAlloc(sizeof(mpz_t)*(final_base_dim+1));
     379        polyexp=(mono_type*)omAlloc(sizeof(mono_type)*(final_base_dim+1));
    383380        for (i=0;i<=final_base_dim;i++)
    384381        {
     
    406403     my_row=(modp_number*)omAlloc0(sizeof(modp_number)*final_base_dim);
    407404     my_solve_row=(modp_number*)omAlloc0(sizeof(modp_number)*final_base_dim);
    408      column_name=(mono_type*)omAlloc0(sizeof(mono_type)*final_base_dim);
     405     column_name=(mono_type*)omAlloc(sizeof(mono_type)*final_base_dim);
    409406     for (i=0;i<final_base_dim;i++) column_name[i]=ZeroMonomial ();
    410407     last_solve_column=0;
     
    415412
    416413// produces table of modp inverts by finding a generator of (Z_myp*,*)
    417      gen_table=(modp_number*)omAlloc0(sizeof(modp_number)*myp);
     414     gen_table=(modp_number*)omAlloc(sizeof(modp_number)*myp);
    418415     gen_table[1]=1;
    419416     for (pos_gen=2;pos_gen<myp;pos_gen++)
     
    537534    int j,k;
    538535    mono_type mn;
    539     mn=(exponent*)omAlloc0(sizeof(exponent)*variables);
     536    mn=(exponent*)omAlloc(sizeof(exponent)*variables);
    540537    memcpy(mn,mon,sizeof(exponent)*variables);
    541538    for (k=0;k<variables;k++)
     
    562559    int j,k;
    563560    mono_type mn;
    564     mn=(exponent*)omAlloc0(sizeof(exponent)*variables);
     561    mn=(exponent*)omAlloc(sizeof(exponent)*variables);
    565562    memcpy(mn,mon,sizeof(exponent)*variables);
    566563    for (k=0;k<variables;k++)
     
    992989     }
    993990     temp=(generator_entry*)omAlloc0(sizeof(generator_entry));
    994      if (prev_ptr==NULL) cur_result->generator=temp; else prev_ptr->next=temp;
     991     if (prev_ptr==NULL) cur_result->generator=temp;
     992     else prev_ptr->next=temp;
    995993     temp->next=NULL;
    996994     temp->coef=(modp_number*)omAlloc0(sizeof(modp_number)*final_base_dim);
     
    13751373     if (prev==NULL) gen_list=temp; else prev->next=temp;
    13761374     temp->next=NULL;
    1377      temp->polycoef=(mpz_t*)omAlloc0(sizeof(mpz_t)*(final_base_dim+1));
    1378      temp->polyexp=(mono_type*)omAlloc0(sizeof(mono_type)*(final_base_dim+1));
     1375     temp->polycoef=(mpz_t*)omAlloc(sizeof(mpz_t)*(final_base_dim+1));
     1376     temp->polyexp=(mono_type*)omAlloc(sizeof(mono_type)*(final_base_dim+1));
    13791377     for (i=0;i<=final_base_dim;i++)
    13801378     {
  • Singular/misc_ip.cc

    ra80025e raad4e14  
    381381
    382382#ifdef HAVE_FACTORY
     383#define SI_DONT_HAVE_GLOBAL_VARS
    383384#include <factory/factory.h>
    384385// libfac:
Note: See TracChangeset for help on using the changeset viewer.