forked from boostorg/smart_ptr
Make as_allocator::deallocate consistent
This commit is contained in:
@ -160,12 +160,13 @@ namespace boost {
|
|||||||
M = boost::alignment_of<type>::value
|
M = boost::alignment_of<type>::value
|
||||||
};
|
};
|
||||||
std::size_t n1 = count * sizeof(value_type) + M - 1;
|
std::size_t n1 = count * sizeof(value_type) + M - 1;
|
||||||
|
std::size_t n2 = size * sizeof(type);
|
||||||
char* p1 = reinterpret_cast<char*>(memory);
|
char* p1 = reinterpret_cast<char*>(memory);
|
||||||
CA ca(*this);
|
CA ca(*this);
|
||||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||||
CT::deallocate(ca, p1, size + n1);
|
CT::deallocate(ca, p1, n1 + n2);
|
||||||
#else
|
#else
|
||||||
ca.deallocate(p1, size + n1);
|
ca.deallocate(p1, n1 + n2);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user