diff --git a/contrib/other-builds/moses2/MemPool.h b/contrib/other-builds/moses2/MemPool.h index 107306c53..d39d5c289 100644 --- a/contrib/other-builds/moses2/MemPool.h +++ b/contrib/other-builds/moses2/MemPool.h @@ -12,6 +12,7 @@ #include #include #include +#include class MemPool { struct Page { @@ -134,7 +135,10 @@ class ObjectPoolContiguous { void push(T &obj) { if (m_size >= m_actualSize) { - m_vec = (T*) realloc(m_vec, m_size * 2); + //std::cerr << std::endl << "MORE " << m_size << std::endl; + m_actualSize *= 2; + m_vec = (T*) realloc(m_vec, sizeof(T) * m_actualSize); + } m_vec[m_size] = obj; ++m_size;