Statically allocate futex array v2017.12.04.00
authorAlastair Daivis <alaroldai@fb.com>
Sun, 3 Dec 2017 01:35:33 +0000 (17:35 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 3 Dec 2017 01:51:46 +0000 (17:51 -0800)
commit0d13183a2c02539d216e6f16f8b27a8ffb359190
tree9db5d3f47b8854248e64fa49f0ed599457eccf8a
parent4bec077b3dc283e75125e9cf95fad89ca6617101
Statically allocate futex array

Summary:
AFAICT this is currently the only thing preventing the non-dynamic version of Folly's MPMCQueue from being allocation-free on enqueue and dequeue operations. Allocating this with a constant expression should move the allocation from runtime to link (possibly compile?) time, which will let us use it in allocation sensitive contexts.

Feel free to suggest other reviewers, I couldn't find an existing folly reviewer group.

Reviewed By: yfeldblum, agola11, nbronson

Differential Revision: D6447848

fbshipit-source-id: 86b84b19d62f1e1bcecdb9e757a6dfa90597b084
folly/Portability.h
folly/detail/Futex.cpp