Avoid allocs in dtors in futures collect
authorYedidya Feldblum <yfeldblum@fb.com>
Wed, 3 Jan 2018 21:41:22 +0000 (13:41 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 3 Jan 2018 21:57:24 +0000 (13:57 -0800)
commit92d510df9827c34f0384cd289c957a6983ce8f4a
tree93fe264ea89b2ead59825ef3c17e0434c298729d
parenteba5e7f2236a0950957a8a247a0e83385149d13c
Avoid allocs in dtors in futures collect

Summary:
[Folly] Avoid allocs in dtors in futures `collect`.

`CollectContext`, a detail helper type, allocates storage for a results vector in its dtor. This is an awkward situation and should be avoided.

Reviewed By: ericniebler

Differential Revision: D6649299

fbshipit-source-id: 87746fcc78fa080f63505d7bb864aca6c4a3d7cb
folly/futures/Future-inl.h