forked from boostorg/smart_ptr
Rename identifiers in allocate and deallocate
This commit is contained in:
@ -666,19 +666,17 @@ public:
|
|||||||
|
|
||||||
value_type* allocate(std::size_t count) {
|
value_type* allocate(std::size_t count) {
|
||||||
type_allocator allocator(allocator_);
|
type_allocator allocator(allocator_);
|
||||||
std::size_t head = sp_align<value_type, alignment>(count);
|
std::size_t node = sp_align<value_type, alignment>(count);
|
||||||
std::size_t tail = sizeof(T) * size_;
|
std::size_t size = sp_types<type>(node + sizeof(T) * size_);
|
||||||
std::size_t size = sp_types<type>(head + tail);
|
|
||||||
type* address = allocator.allocate(size);
|
type* address = allocator.allocate(size);
|
||||||
*result_ = reinterpret_cast<char*>(address) + head;
|
*result_ = reinterpret_cast<char*>(address) + node;
|
||||||
return reinterpret_cast<value_type*>(address);
|
return reinterpret_cast<value_type*>(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
void deallocate(value_type* value, std::size_t count) {
|
void deallocate(value_type* value, std::size_t count) {
|
||||||
type_allocator allocator(allocator_);
|
type_allocator allocator(allocator_);
|
||||||
std::size_t head = sp_align<value_type, alignment>(count);
|
std::size_t node = sp_align<value_type, alignment>(count);
|
||||||
std::size_t tail = sizeof(T) * size_;
|
std::size_t size = sp_types<type>(node + sizeof(T) * size_);
|
||||||
std::size_t size = sp_types<type>(head + tail);
|
|
||||||
allocator.deallocate(reinterpret_cast<type*>(value), size);
|
allocator.deallocate(reinterpret_cast<type*>(value), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user