alloc/allocator: take type into account for sizes and ptrs

This commit is contained in:
Danny Robson 2018-03-07 17:57:10 +11:00
parent 87fc5df03d
commit d00d724296

View File

@ -35,16 +35,19 @@ namespace util::alloc {
{ ; }
ValueT* allocate (size_t count)
ValueT*
allocate (size_t count)
{
return m_backing.template allocate<ValueT> (count);
return reinterpret_cast<ValueT*> (
m_backing.template allocate (sizeof (ValueT) * count)
);
}
void
deallocate (ValueT *t, size_t count)
{
return m_backing.template deallocate (t, count);
return m_backing.template deallocate (t, sizeof (ValueT) * count);
}