|
|
@ -64,7 +64,7 @@ namespace DFHack
|
|
|
|
if (newsize == size)
|
|
|
|
if (newsize == size)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
uint8_t* mem = (uint8_t *) realloc(bits, newsize);
|
|
|
|
uint8_t* mem = (uint8_t *) realloc(bits, newsize);
|
|
|
|
if(!mem)
|
|
|
|
if(!mem && newsize != 0)
|
|
|
|
throw std::bad_alloc();
|
|
|
|
throw std::bad_alloc();
|
|
|
|
bits = mem;
|
|
|
|
bits = mem;
|
|
|
|
if (newsize > size)
|
|
|
|
if (newsize > size)
|
|
|
@ -207,7 +207,7 @@ namespace DFHack
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
T* mem = (T*) realloc(m_data, sizeof(T)*new_size);
|
|
|
|
T* mem = (T*) realloc(m_data, sizeof(T)*new_size);
|
|
|
|
if(!mem)
|
|
|
|
if(!mem && new_size != 0)
|
|
|
|
throw std::bad_alloc();
|
|
|
|
throw std::bad_alloc();
|
|
|
|
m_data = mem;
|
|
|
|
m_data = mem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|