Fix allocation size vector
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <stdexcept>
|
||||
|
||||
@@ -12,7 +11,7 @@ protected:
|
||||
public:
|
||||
void Resize(std::size_t const newSize)
|
||||
{
|
||||
void * result = std::realloc(data, newSize);
|
||||
void * result = std::realloc(data, newSize * sizeof(T));
|
||||
if(result == nullptr)
|
||||
{
|
||||
throw std::runtime_error("Cannot allocate the requested size of memory.");
|
||||
|
||||
Reference in New Issue
Block a user