diff --git a/include/boost/smart_ptr/allocate_shared_array.hpp b/include/boost/smart_ptr/allocate_shared_array.hpp index 2028795..b43b43d 100644 --- a/include/boost/smart_ptr/allocate_shared_array.hpp +++ b/include/boost/smart_ptr/allocate_shared_array.hpp @@ -666,19 +666,17 @@ public: value_type* allocate(std::size_t count) { type_allocator allocator(allocator_); - std::size_t head = sp_align(count); - std::size_t tail = sizeof(T) * size_; - std::size_t size = sp_types(head + tail); + std::size_t node = sp_align(count); + std::size_t size = sp_types(node + sizeof(T) * size_); type* address = allocator.allocate(size); - *result_ = reinterpret_cast(address) + head; + *result_ = reinterpret_cast(address) + node; return reinterpret_cast(address); } void deallocate(value_type* value, std::size_t count) { type_allocator allocator(allocator_); - std::size_t head = sp_align(count); - std::size_t tail = sizeof(T) * size_; - std::size_t size = sp_types(head + tail); + std::size_t node = sp_align(count); + std::size_t size = sp_types(node + sizeof(T) * size_); allocator.deallocate(reinterpret_cast(value), size); }