Skip to content

Commit f5da64e

Browse files
committed
Fix MSVC 32 bit debug configuration runtime crash
1 parent 4513c65 commit f5da64e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/async_writer.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,28 @@ void AsyncWriter::queueBatchWrite(BatchedWriteTasks&& tasks, OptionalWriteDeadli
6565
}
6666
}
6767

68+
#if !defined(NDEBUG) && defined(_MSC_VER) && UINTPTR_MAX == 0xFFFFFFFF
69+
70+
struct __declspec(align(16)) const_buffer_small_vector_type : boost::container::small_vector<boost::asio::const_buffer, 16>
71+
{
72+
};
73+
74+
using const_buffer_small_vector = const_buffer_small_vector_type;
75+
76+
#else
77+
78+
using const_buffer_small_vector = boost::container::small_vector<boost::asio::const_buffer, 16>;
79+
80+
#endif
81+
6882
void AsyncWriter::doWrite(const BatchedWriteTasksWithDeadline& tasksWithDeadline)
6983
{
7084
if (timeoutReached)
7185
return;
7286

7387
const auto& tasks = tasksWithDeadline.first;
7488

75-
boost::container::small_vector<boost::asio::const_buffer, 16> buffers;
89+
const_buffer_small_vector buffers;
7690

7791
for (const auto& task : tasks)
7892
{

0 commit comments

Comments
 (0)