Ignore:
Timestamp:
10/13/15 15:14:23 (9 years ago)
Author:
rlacroix
Message:

Correctly estimate the needed buffer sizes.

The attributes were not considered which could lead to incorrect estimations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/array_new.hpp

    r680 r731  
    518518      virtual void reset(void) { this->free(); initialized = false; } 
    519519      virtual bool isEmpty(void) const { return !initialized; } 
    520       virtual size_t size(void) const { return (this->dimensions() + 1) * sizeof(int) + sizeof(size_t) + this->numElements() * sizeof(T_numtype); } 
     520      virtual size_t size(void) const { return size(this->numElements()); } 
     521      static size_t size(sizeType numElements) { return (N_rank + 1) * sizeof(int) + sizeof(size_t) + numElements * sizeof(T_numtype); } 
    521522 
    522523      virtual CBaseType* clone(void) const { return new CArray(*this); } 
Note: See TracChangeset for help on using the changeset viewer.