Skip to content
Snippets Groups Projects
Commit b8c2283d authored by Sean McBride's avatar Sean McBride Committed by Kitware Robot
Browse files

Merge topic 'use-realloc-on-OSX'


cc8c3ac4 Removed OS X specific avoidance of realloc()

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1448
parents ff55b204 cc8c3ac4
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