[vtkusers] BUG in 64bit vtkDataArrayTemplate

Berk Geveci berk.geveci at kitware.com
Mon Jul 23 09:13:55 EDT 2007


This is definitely a bug. I will fix this on the development version of VTK.

-berk

On 7/13/07, Andreas M. Gerndt <andreas at louisiana.edu> wrote:
> I am working on a very huge terrain dataset consisting of multiple tiles. I
> hit the 32bit limit of point numbers so that I recompiled VTK with the
> VTK_USE_64BITS_IDS flag set. Nevertheless, appending data still crashed. The
> reason was the usage of an "int" in vtkDataArrayTemplate.txx. Changing it to
> vtkIdType fixed this problem.
>
> //----------------------------------------------------------------------------
> // Allocate memory for this array. Delete old storage only if necessary.
> template <class T>
> int vtkDataArrayTemplate<T>::Allocate(vtkIdType sz, vtkIdType)
> {
> ...
>     //=========================================
>     int newSize = (sz > 0 ? sz : 1);
>     //=========================================
>     this->Array = (T*)malloc(newSize * sizeof(T));
>     if(!this->Array)
>       {
>       vtkErrorMacro("Unable to allocate " << newSize
>                     << " elements of size " << sizeof(T)
>                     << " bytes. ");
>       return 0;
>       }
>     this->Size = newSize;
>     }
>
>   return 1;
> }
> //----------------------------------------------------------------------------
>
> I guess this is a BUG, isn't it???
>
> Andreas
>
> --
>
> --------------------------------------------
> Andreas M. Gerndt
> Louisiana Immersive Technologies Enterprise
> University of Louisiana at Lafayette (ULL)
> 537 Cajundome Boulevard
> Lafayette, LA 70506, USA
> Office: (337) 482-9609
> Fax: (337) 735-1346
> mailto: andreas at louisiana.edu
> http://www.lite3d.com
> http://www.ull.edu
> --------------------------------------------
> .
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list