From a821e7459e8ba6bc42bc17f027e6113abb2fc8e5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 May 2016 13:05:16 +0530 Subject: [PATCH] Remove pool growing code, that did not work anyway --- src/calibre/utils/imageops/quantize.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/calibre/utils/imageops/quantize.cpp b/src/calibre/utils/imageops/quantize.cpp index 06d1b14b0d..c2293765fd 100644 --- a/src/calibre/utils/imageops/quantize.cpp +++ b/src/calibre/utils/imageops/quantize.cpp @@ -58,13 +58,7 @@ public: T *ans = this->first_available; if (ans == NULL) throw std::out_of_range("Something bad happened: ran out of nodes in the pool"); this->first_available = ans->next_available_in_pool; - if (this->first_available == NULL) { - // Grow the pool - int size = this->nodes.size(); - this->nodes.resize(2*size); - this->first_available = &this->nodes[size]; - for (int i = size; i < 2*size - 1; i++) this->nodes[i].next_available_in_pool = &this->nodes[i+1]; - } + if (this->first_available == NULL) throw std::out_of_range("Memory Pool is exhausted, this should never happen"); return ans; }