/[escript]/trunk/escript/src/Taipan.cpp
ViewVC logotype

Diff of /trunk/escript/src/Taipan.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 782 by bcumming, Tue Jul 18 00:47:47 2006 UTC revision 797 by gross, Thu Aug 3 02:03:18 2006 UTC
# Line 64  Taipan::~Taipan() { Line 64  Taipan::~Taipan() {
64    totalElements = -1;    totalElements = -1;
65  }  }
66    
67    void
68    Taipan::release_unused_arrays()
69    {
70      long len=0;
71      Taipan_MemTable *tab;
72      Taipan_MemTable *tab_next, *tab_prev=0;
73      tab = memTable_Root;
74      while (tab != 0) {
75          tab_next = tab->next;
76          if (tab->free) {
77            delete[] tab->array;
78            len += tab->dim * tab->N;
79            if (tab_prev != 0) {
80              tab_prev->next = tab->next;
81            } else {
82              memTable_Root = tab->next;
83            }
84            delete tab;
85            // increment count of arrays dealloced
86            statTable->deallocations++;
87          } else {
88            tab_prev = tab;
89          }
90          tab = tab_next;
91      }
92      totalElements -= len;
93      statTable->deallocated_elements += len;
94      cout << len*8./1048576 << " Mbytes unused memory has been released." << endl;
95    }
96    
97    
98  double*  double*
99  Taipan::new_array(int dim, int N) {  Taipan::new_array(int dim, int N) {
100    

Legend:
Removed from v.782  
changed lines
  Added in v.797

  ViewVC Help
Powered by ViewVC 1.1.26