[vtkusers] Change in DataArray to use operator new instead of malloc

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[vtkusers] Change in DataArray to use operator new instead of malloc

Utkarsh Ayachit
vtkDataArrayTemplate used malloc()/free()/realloc() to allocate/free
memory. That has now been changed to use the C++ operators new and delete.

This change will affect those who have been passing an array to the
class to manage using SetArray() or SetVoidArray() with the "save"
argument set to "0". Earlier, it was assumed that the array was
allocated using malloc(), now it is required that the array is allocated
using new[].

Utkarsh.
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

[vtkusers] RE: Change in DataArray to use operator new instead ofmalloc

Ken Martin
Why the change and the break with backwards compatibility?

> -----Original Message-----
> From: vtk-developers-bounces+ken.martin=[hidden email] [mailto:vtk-
> developers-bounces+ken.martin=[hidden email]] On Behalf Of Utkarsh
> Ayachit
> Sent: Tuesday, February 07, 2006 3:47 PM
> To: [hidden email]; 'vtk-developers'
> Subject: [vtk-developers] Change in DataArray to use operator new instead
> ofmalloc
>
> vtkDataArrayTemplate used malloc()/free()/realloc() to allocate/free
> memory. That has now been changed to use the C++ operators new and delete.
>
> This change will affect those who have been passing an array to the
> class to manage using SetArray() or SetVoidArray() with the "save"
> argument set to "0". Earlier, it was assumed that the array was
> allocated using malloc(), now it is required that the array is allocated
> using new[].
>
> Utkarsh.
> _______________________________________________
> vtk-developers mailing list
> [hidden email]
> http://www.vtk.org/mailman/listinfo/vtk-developers

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

[vtkusers] Re: Change in DataArray to use operator new instead of malloc

Mathieu Malaterre-2
In reply to this post by Utkarsh Ayachit
Utkarsh Ayachit wrote:
> vtkDataArrayTemplate used malloc()/free()/realloc() to allocate/free
> memory. That has now been changed to use the C++ operators new and delete.
>
> This change will affect those who have been passing an array to the
> class to manage using SetArray() or SetVoidArray() with the "save"
> argument set to "0". Earlier, it was assumed that the array was
> allocated using malloc(), now it is required that the array is allocated
> using new[].

This is bug: #2407

http://vtk.org/Bug/bug.php?op=show&bugid=2407&pos=0

This is a very recent change in VTK, and provided a faster way to
reallocate memory...

Mathieu
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

[vtkusers] Re: Change in DataArray to use operator new instead of malloc

Utkarsh Ayachit
On further inquistion, it was concluded that the change was unncessary
-- and will be discarded.

Thanks for your prompt responses.
Utkarsh.



Mathieu Malaterre wrote:

> Utkarsh Ayachit wrote:
>
>> vtkDataArrayTemplate used malloc()/free()/realloc() to allocate/free
>> memory. That has now been changed to use the C++ operators new and
>> delete.
>>
>> This change will affect those who have been passing an array to the
>> class to manage using SetArray() or SetVoidArray() with the "save"
>> argument set to "0". Earlier, it was assumed that the array was
>> allocated using malloc(), now it is required that the array is allocated
>> using new[].
>
>
> This is bug: #2407
>
> http://vtk.org/Bug/bug.php?op=show&bugid=2407&pos=0
>
> This is a very recent change in VTK, and provided a faster way to
> reallocate memory...
>
> Mathieu
>

_______________________________________________
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