Changeset 12353


Ignore:
Timestamp:
06/04/12 10:48:58 (13 years ago)
Author:
utke
Message:

add an xNewInit; I am thinking that for performance
perhaps these implementations should still be switchable
to the C system calls when IssmDouble just is double.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/shared/Alloc/xNewDelete.h

    r12320 r12353  
    1515};
    1616
     17template <class T>
     18T* xNewInit(unsigned int size, const T initVal) {
     19  T* aT_p=new T[size];
     20  assert(aT_p);
     21  for (int i=0; i<size;++i)
     22    aT_p[i]=initVal;
     23  return aT_p;
     24};
     25
    1726template <class T>
    1827void xDelete(T*& aT_p) {
Note: See TracChangeset for help on using the changeset viewer.