Changeset 1857 in Sophya for trunk/SophyaPI/PIGcont/pigncont.cc


Ignore:
Timestamp:
Jan 14, 2002, 2:42:24 PM (24 years ago)
Author:
perderos
Message:

1) correction de fuites de memoire
2) integration de glpc_set.* ds gp_contour (variables en commun)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIGcont/pigncont.cc

    r1853 r1857  
    1212#include "picntools.h"
    1313#include "pigncont.h"
     14
     15#include <sys/time.h>
     16#include <sys/resource.h>
    1417
    1518/*  A virer ?? Reza 21/12/2001
     
    369372 
    370373 struct gnuplot_contours *cntcur = _contours;
     374 /*****
    371375 struct gnuplot_contours *cntold;
    372376
    373  while(cntcur) {
     377 while(cntcur) { 
    374378   //cout << " ~GNUPlotContour() : destruction de _contours" << _contours <<endl;
    375    cntold = cntcur;
    376    cntcur = cntold->next;
    377    gp_free(cntold);
    378    cntold=NULL;
    379  }
    380  
     379   cntold = cntcur;
     380   cntcur = cntold->next;
     381   gp_free(cntold);
     382   cntold=NULL;
     383 } 
     384 *******/
     385 contour_free(cntcur);
    381386 _contours = NULL;
    382387
     
    390395
    391396void GNUPlotContour::CalcContour(){
    392  cout << " GNUPlotContour::CalcContour(): determination des contours "<<endl;
     397  //cout << " GNUPlotContour::CalcContour(): determination des contours "<<endl;
     398
     399 struct rusage r_usage;
     400 int rcus;
    393401
    394402 set_contour_kind(Contour_kind);
     
    416424  }
    417425
     426 
     427 rcus = getrusage( RUSAGE_SELF , &r_usage);
     428
     429 //if(rcus==0)
     430 //  cout << " rusage -> "<<  r_usage.ru_maxrss <<" , "<< r_usage.ru_ixrss <<" , "<< r_usage.ru_ixrss <<endl;
     431 //else
     432 //  perror("1er appel");
     433
    418434 if(_contours) {
    419    //cout << " GNUPlotContour::CalcContour(): destruction des contours "<<endl;
     435   cout << " GNUPlotContour::CalcContour(): destruction des contours "<<_contours<<endl;
    420436   struct gnuplot_contours *cntcur = _contours;
    421    struct gnuplot_contours *cntold;
    422    while(cntcur) {
    423      cntold = cntcur;
    424      cntcur = cntold->next;
    425      gp_free(cntold);
    426    }
     437   /******
     438   struct gnuplot_contours *cntold;
     439   while(cntcur) {
     440   cout << " GNUPlotContour::CalcContour(): destruction des contours "<< cntcur<<endl;
     441     cntold = cntcur;
     442     cntcur = cntold->next;
     443     gp_free(cntold);
     444     cntold = NULL;
     445   }
     446   ******/
     447   contour_free(cntcur);
    427448   _contours = NULL;
    428449   
    429450 }
    430451
    431    
    432  
    433  //struct gnuplot_contours *cntcur;
     452 //struct gnuplot_contours *cntcur;
    434453 //struct gnuplot_contours *cntold;
    435454 
     455
     456 //rcus = getrusage( RUSAGE_SELF , &r_usage);
     457 //if(rcus==0)
     458 //  cout << " rusage -> "<< r_usage.ru_maxrss <<" , "<< r_usage.ru_ixrss <<" , "<< r_usage.ru_ixrss <<endl;
     459 //else
     460 //  perror("2d appel");
     461
     462
    436463 _contours = contour (_nx,iso1);
     464 
     465
     466 //rcus = getrusage( RUSAGE_SELF , &r_usage);
     467 //if(rcus==0)
     468 //  cout << " rusage -> "<<  r_usage.ru_maxrss <<" , "<< r_usage.ru_ixrss <<" , "<< r_usage.ru_ixrss <<endl;
     469 //else
     470 //  perror("3ieme appel");
     471
    437472 //free_contour_levels_list();
    438 
     473 
    439474 
    440475}
Note: See TracChangeset for help on using the changeset viewer.