From 60de42be496215200986f6ed5f81a11280c44fbd Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 9 Mar 2009 09:38:00 +0000 Subject: (svn r15649) -Fix (r15556): don't unnecessarily reallocate --- src/core/alloc_type.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/core/alloc_type.hpp b/src/core/alloc_type.hpp index b95fc79ee..4451f0479 100644 --- a/src/core/alloc_type.hpp +++ b/src/core/alloc_type.hpp @@ -102,6 +102,7 @@ public: if (this->count < count) { free(this->buffer); this->buffer = MallocT(count); + this->count = count; } return this->buffer; } @@ -118,6 +119,7 @@ public: if (this->count < count) { free(this->buffer); this->buffer = CallocT(count); + this->count = count; } else { memset(this->buffer, 0, sizeof(T) * count); } -- cgit v1.2.3-70-g09d2