[vtk-developers] vtkGPUInfo and large amounts of memory

David Cole dlrdave at aol.com
Mon Jul 7 09:34:22 EDT 2014


> "The other David"™

:-)


> To answer more directly, I
> brought this up because I made this change the other day:
>
> <http://review.source.kitware.com/15924>
>
> and noticed the possibility of overflow.
>
> ...
> ... just a size count, for which size_t seems the best type (as it's
> what sizeof() returns).

Right, but using size_t will still give you a potential overflow
problem in a 32-bit pointer build... Shouldn't the type *always* be
large enough to represent expected actual memory sizes encountered in
the wild? And therefore, shouldn't it be something that's always at
least 64-bits wide as "the other David" suggested...?

Don't even get me started on what vtkIdType *is* correct for
semantically... "id" to me implies something that can identify an
object across a wide swath of operations. Since it's almost always just
an index into some array, a vtkIdType value does not really "id"
anything, *except* in a given container filled once with data and no
inserts or removes allowed. Fortunately for VTK, that's the main use
case when visualizing a large data set.


David C.





More information about the vtk-developers mailing list