Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions asio/include/asio/any_completion_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class any_completion_handler_impl :
(get_associated_immediate_executor)(handler_, candidate));
}

void* allocate(std::size_t size, std::size_t align) const
void* allocate(std::size_t size, std::size_t align_size) const
{
typename std::allocator_traits<
associated_allocator_t<Handler,
Expand All @@ -137,13 +137,13 @@ class any_completion_handler_impl :
(get_associated_allocator)(handler_,
asio::recycling_allocator<void>()));

std::size_t space = size + align - 1;
std::size_t space = size + align_size - 1;
unsigned char* base =
std::allocator_traits<decltype(alloc)>::allocate(
alloc, space + sizeof(std::ptrdiff_t));

void* p = base;
if (detail::align(align, size, p, space))
if (detail::align(align_size, size, p, space))
{
std::ptrdiff_t off = static_cast<unsigned char*>(p) - base;
std::memcpy(static_cast<unsigned char*>(p) + size, &off, sizeof(off));
Expand Down