Skip to content
Snippets Groups Projects
Commit cc8c3ac4 authored by Sean McBride's avatar Sean McBride
Browse files

Removed OS X specific avoidance of realloc()

Changed to just use realloc() as with other OSes.
The code path forced by this was much slower, as
measured by Instruments.app.
parent 3654a15b
No related branches found
No related tags found
No related merge requests found
......@@ -148,17 +148,8 @@ bool vtkBuffer<ScalarT>::Reallocate(vtkIdType newsize)
{
if (newsize == 0) { return this->Allocate(0); }
// OS X's realloc does not free memory if the new block is smaller. This
// is a very serious problem and causes huge amount of memory to be
// wasted. Do not use realloc on the Mac.
bool dontUseRealloc=false;
#if defined __APPLE__
dontUseRealloc=true;
#endif
if (this->Pointer &&
(this->Save || this->DeleteMethod == VTK_DATA_ARRAY_DELETE ||
dontUseRealloc))
(this->Save || this->DeleteMethod == VTK_DATA_ARRAY_DELETE))
{
ScalarType* newArray =
static_cast<ScalarType*>(malloc(newsize * sizeof(ScalarType)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment