#include <boost/asio.hpp>
#include <boost/intrusive/list.hpp>
+#include <boost/context/protected_fixedsize_stack.hpp>
#include <spawn/spawn.hpp>
#include "common/async/shared_mutex.h"
using parse_buffer = boost::beast::flat_static_buffer<65536>;
+// use mmap/mprotect to allocate 512k coroutine stacks
+auto make_stack_allocator() {
+ return boost::context::protected_fixedsize_stack{512*1024};
+}
+
template <typename Stream>
class StreamIO : public rgw::asio::ClientIO {
CephContext* const cct;
stream.async_shutdown(yield[ec]);
}
s.shutdown(tcp::socket::shutdown_both, ec);
- });
+ }, make_stack_allocator());
} else {
#else
{
handle_connection(context, env, s, *buffer, false, pause_mutex,
scheduler.get(), ec, yield);
s.shutdown(tcp::socket::shutdown_both, ec);
- });
+ }, make_stack_allocator());
}
}