EventCount: "condition variable" for lock-free algorithms

Summary:
This allows you to convert non-blocking lock-free algorithms into
blocking versions.

See
http://www.1024cores.net/home/lock-free-algorithms/eventcounts,
http://software.intel.com/en-us/forums/showthread.php?t=62364,
http://www.akkadia.org/drepper/futex.pdf

Test Plan: new test

Reviewed By: delong.j@fb.com

FB internal diff: D474570
Deuglify unaligned accesses in GroupVarint.

Test Plan: folly/test

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D488631
Add links to README.

Test Plan: No

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D489199
Add IOBufQueue::wrapBuffer, which handles buffers > 4GB.

Test Plan: test added

Reviewed By: brianp@fb.com

FB internal diff: D489158
folly::detail::futex should be inline

Summary: It breaks build.

Test Plan: will check *_try builds

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D489935
D'oh: fix size computation in ThreadLocalDetail.h

Test Plan: thread_local_test

Reviewed By: ldemailly@fb.com

FB internal diff: D490912
Typos.

Test Plan: No

Reviewed By: delong.j@fb.com

FB internal diff: D491038
Add IOBuf::takeOwnership(unique_ptr<T>&&).

Summary:
Useful for in-place serialization.  Dangerous, obviously, but anything
involving IOBuf usually is.

Test Plan: test added

Reviewed By: brianp@fb.com

FB internal diff: D491663
Properly align internal buffer in IOBuf.

Summary:
Yes, it's gcc specific, because alignas and max_align_t aren't in gcc
4.6.2.

Test Plan: iobuf_test, test added

Reviewed By: brianp@fb.com

FB internal diff: D491939
InternalBuf doesn't need capacity

Summary: as it's always kMaxInternalDataSize.

Test Plan: all tests in folly/experimental/io/test, both opt and dbg

Reviewed By: brianp@fb.com

FB internal diff: D492008
Move Rabin fingerprinting code to folly.

Summary:
Also generate fingerprint tables every time, so the code doesn't rot.

TODO(tudorb): move benchmark to folly
TODO(tudorb): Include the program used to generate the polynomials
(can't build as it requires NTL from http://www.shoup.net/ntl/)

Test Plan: folly/test

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D492455
Fix build and test.

Summary:
Fix bug in FBStringTest (don't reuse the same file name)

Don't use VLOG, as that requires that glog is compiled with gflags
support, which it isn't always.

Add other targets and tests, make all tests pass.

Test Plan: tests

Reviewed By: delong.j@fb.com

FB internal diff: D493018
Fix build and test.

Summary:
Fix bug in FBStringTest (don't reuse the same file name)

Don't use VLOG, as that requires that glog is compiled with gflags
support, which it isn't always.

Add other targets and tests, make all tests pass.

Test Plan: tests

Reviewed By: delong.j@fb.com

FB internal diff: D493018
Fix intermittent failure in concurrent_skip_list_test

Summary: It creates too many threads, stop when we run out of resources.

Test Plan: by hand, in a loop, in a memory-constrained environment

Reviewed By: delong.j@fb.com

FB internal diff: D493239
Fix narrowing warning (if enabled).

Summary: They're (signed) long long.

Test Plan: built, folly/test

Reviewed By: andrewjcg@fb.com

FB internal diff: D493270
Move and refactor code

Summary:

Moves some string manipulation code like humanify into folly

Moves hash-related functions into folly and removes some old includes
to clean up some code

Adds generic hashing for tuples, similar to pairs

Updates all of the build breakages from the above

Test Plan: run unit tests

Reviewed By: delong.j@fb.com

FB internal diff: D490478
Clarify split / splitTo comments.

Test Plan: No

Reviewed By: delong.j@fb.com

FB internal diff: D494525
Fix clang narrowing error in GroupVarintTables

Summary:
The __m128i type is a pair of 64-bit signed ints and the values
generated in generate_varint_tables.py overflow this range, which
causes clang to complain.

Test Plan:
Built and ran unittests.  Also verified that the GroupVarintTable.o
data section was identical with and w/o this change.

Reviewed By: tudorb@fb.com

FB internal diff: D494645
Unbreak Ubuntu build.

Summary: follybenchmark and follyfingerprint need folly to work.

Test Plan: built on ubuntu

Reviewed By: andrewjcg@fb.com

FB internal diff: D494955
Fix a typo in benchmark comments

Summary: As title

Test Plan: Deployed to wormhole_apps.dragon.dev

Reviewed By: asharma@fb.com

FB internal diff: D493253