chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.73k stars 1.2k forks source link

Is it possible to provide custom allocator for the creation of coroutine? #1311

Open Kelvinyu1117 opened 1 year ago

Kelvinyu1117 commented 1 year ago

From my knowledge, the creation of a coroutine requires dynamic allocation in general (although it can be optimized out sometimes). In some cases, we may want to minimize the allocations in runtime and we may have our own memory allocator with a big chunk of preallocated memory.

In Asio, is it possible to allow the user to provide the custom memory allocator to the library such that the user can override the new and delete operators of the awaitable_frame_base class?