diff options
author | rubidium <rubidium@openttd.org> | 2009-03-09 09:38:00 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-03-09 09:38:00 +0000 |
commit | 60de42be496215200986f6ed5f81a11280c44fbd (patch) | |
tree | a63c3729163ccf5b1c637ba9d01103839d3fe94a | |
parent | a231ab7560cb27e5c217082dde3b4490cdc961e6 (diff) | |
download | openttd-60de42be496215200986f6ed5f81a11280c44fbd.tar.xz |
(svn r15649) -Fix (r15556): don't unnecessarily reallocate
-rw-r--r-- | src/core/alloc_type.hpp | 2 |
1 files changed, 2 insertions, 0 deletions
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<T>(count); + this->count = count; } return this->buffer; } @@ -118,6 +119,7 @@ public: if (this->count < count) { free(this->buffer); this->buffer = CallocT<T>(count); + this->count = count; } else { memset(this->buffer, 0, sizeof(T) * count); } |