[patch] Avoid memory allocations when making futures ready

Jonathan Wakely jwakely@redhat.com
Thu Aug 7 20:13:00 GMT 2014


This patch replaces some reference members with pointers, so that the
types containing them become trivial and are more efficient to pass as
function arguments and can use the small object optimization when
stored in a std::function, so that promise::set_value() doesn't need
to allocate any memory.

_Task_setter is also changed to store a pointer to the task, instead
of using a std::function to hold it.

Tested x86_64-linux, committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 10559 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20140807/cf8b8bed/attachment.bin>


More information about the Libstdc++ mailing list