/[escript]/trunk/dudley/src/IndexList.cpp
ViewVC logotype

Diff of /trunk/dudley/src/IndexList.cpp

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

revision 4261 by jfenwick, Wed Feb 27 06:09:33 2013 UTC revision 4335 by jfenwick, Thu Mar 21 07:35:48 2013 UTC
# Line 153  void Dudley_IndexList_insertIndex(Dudley Line 153  void Dudley_IndexList_insertIndex(Dudley
153      /* if in->index is full check the extension */      /* if in->index is full check the extension */
154      if (in->extension == NULL)      if (in->extension == NULL)
155      {      {
156          in->extension = TMPMEMALLOC(1, Dudley_IndexList);          in->extension = new Dudley_IndexList;
157          if (Dudley_checkPtr(in->extension))          if (Dudley_checkPtr(in->extension))
158          return;          return;
159          in->extension->n = 0;          in->extension->n = 0;
# Line 223  void Dudley_IndexList_free(Dudley_IndexL Line 223  void Dudley_IndexList_free(Dudley_IndexL
223      if (in != NULL)      if (in != NULL)
224      {      {
225      Dudley_IndexList_free(in->extension);      Dudley_IndexList_free(in->extension);
226      TMPMEMFREE(in);      delete in;
227      }      }
228  }  }
229    
# Line 236  Paso_Pattern *Dudley_IndexList_createPat Line 236  Paso_Pattern *Dudley_IndexList_createPat
236      index_t *index = NULL;      index_t *index = NULL;
237      Paso_Pattern *out = NULL;      Paso_Pattern *out = NULL;
238    
239      ptr = MEMALLOC(n + 1 - n0, index_t);      ptr = new index_t[n + 1 - n0];
240      if (!Dudley_checkPtr(ptr))      if (!Dudley_checkPtr(ptr))
241      {      {
242      /* get the number of connections per row */      /* get the number of connections per row */
# Line 255  Paso_Pattern *Dudley_IndexList_createPat Line 255  Paso_Pattern *Dudley_IndexList_createPat
255      }      }
256      ptr[n - n0] = s;      ptr[n - n0] = s;
257      /* fill index */      /* fill index */
258      index = MEMALLOC(ptr[n - n0], index_t);      index = new index_t[ptr[n - n0]];
259      if (!Dudley_checkPtr(index))      if (!Dudley_checkPtr(index))
260      {      {
261  #pragma omp parallel for schedule(static)  #pragma omp parallel for schedule(static)
# Line 268  Paso_Pattern *Dudley_IndexList_createPat Line 268  Paso_Pattern *Dudley_IndexList_createPat
268      }      }
269      if (!Dudley_noError())      if (!Dudley_noError())
270      {      {
271      MEMFREE(ptr);      delete[] ptr;
272      MEMFREE(index);      delete[] index;
273      Paso_Pattern_free(out);      Paso_Pattern_free(out);
274      }      }
275      return out;      return out;

Legend:
Removed from v.4261  
changed lines
  Added in v.4335

  ViewVC Help
Powered by ViewVC 1.1.26