Commit 635ec3ce authored by Max Kellermann's avatar Max Kellermann

util/VarSize: use plain malloc()

parent 8e71130e
......@@ -30,7 +30,6 @@
#ifndef MPD_VAR_SIZE_HXX
#define MPD_VAR_SIZE_HXX
#include "Alloc.hxx"
#include "Compiler.h"
#include <type_traits>
......@@ -61,7 +60,9 @@ NewVarSize(size_t declared_tail_size, size_t real_tail_size, Args&&... args)
size_t size = sizeof(T) - declared_tail_size + real_tail_size;
/* allocate memory */
T *instance = (T *)xalloc(size);
T *instance = (T *)malloc(size);
if (instance == nullptr)
throw std::bad_alloc{};
/* call the constructor */
new(instance) T(std::forward<Args>(args)...);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment