Add wrapper macros for "final" and "override"

Summary:
... which are supported in gcc 4.7, but not 4.6, and they enable useful
optimizations.  As long as we're planning to support both 4.6 and 4.7 in
our code base, we should write code using these macros.

Test Plan:
test added, compiled with both 4.6 and 4.7, verified the
assertion in the test comment by looking at dissassembly output in the
4.7 version

Reviewed By: delong.j@fb.com

FB internal diff: D520343
Fix an issue in IOBufQueue::move

Summary: That's all.

Test Plan: .

Reviewed By: philipp@fb.com

FB internal diff: D520116
Add folly::applyTuple utility

Summary: Applies a function to a std::tuple of arguments.

Test Plan: Unit test.

Reviewed By: tjackson@fb.com

FB internal diff: D520190
add sched_yield in RWTicketSpinLock

Summary:
This diff makes RWTicketSpinLock eventually start calling
sched_yield() during shared and aggressive exclusive lock access, to
avoid pathologies that can arise when the number of threads far
exceeds the number of actual cores.

Test Plan:
1. unit tests
2. benchmark w/o + w/ diff

Reviewed By: nathan@fb.com

FB internal diff: D524897
Add IEC binary unit prefixes

Summary: KiB, MiB, GiB, TiB, etc

Test Plan: by hand in a program using them

Reviewed By: philipp@fb.com

FB internal diff: D527001
Moving some more benchmarks to fbcode benchmark system

Summary: The format benchmark that was ported some time back has few data points to show - http://fburl.com/3545876

Test Plan: fbmake --log-to-rfe runbenchmarks_opt

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D524306
Make AtomicHashMap support move constructible types

Summary: modified AtomicHashArray and AtomicHashMap to support move constructible types

Test Plan: tested with fbcode/folly/test/AtomicHashArrayTest.cpp and fbcode/folly/test/AtomicHashMapTest.cpp

Reviewed By: philipp@fb.com

FB internal diff: D527270
Allow capacity and length to be different for user buffers

Summary:
Currently, takeOwnership lets a user pass in a data buffer and wraps it in an
IOBuffer. However, the capacity and length of the user buffer are required to
be same.

Added a new API to allow buffers where the capacity and length can be different.

Users of existing API should not be affected.

Test Plan:
1) Added new test case to IOBufTest that checks buffers with length
different from capacity
2) Run existing IOBuf test cases to verify no regressions

Reviewed By: brianp@fb.com

FB internal diff: D536575
Add inverses for jenkins_rev_mix32, twang_mix64

Test Plan: test added

Reviewed By: soren@fb.com

FB internal diff: D538703
fbstring: mute uninitialized warnings in fbstring code

Summary:
fbstring generates some apparently false positive uninitialized warnings
under gcc-4.7.1.  This diff disables the '-Wuninitialized' flag for
fbstring.

Test Plan: build

Reviewed By: ldemailly@fb.com

FB internal diff: D542722
Minor typo in comments

Summary: github pull #11

Test Plan: None.

Reviewed By: andrewjcg@fb.com

FB internal diff: D541230
Remove unused logging header

Test Plan: Compiled.

Reviewed By: andrewjcg@fb.com

FB internal diff: D541226
Add operator== and operator!= to folly::StlAllocator

Summary: Add operator== and operator!= to folly::StlAllocator, which are required by some other libraries.

Test Plan: Tested by running with recursive_wrapper in boost::variant, and unit tests in folly/test.

Reviewed By: delong.j@fb.com

FB internal diff: D541237
folly::dynamic: use std::vector instead of folly::fbvector

Summary:
It appears that std::unordered_map is no longer relocatable in
gcc-4.7.  Use std::vector instead, until fbvector supports non-
relocatable types.

Test Plan: Built and ran facebar tests under gcc-4.7.  Also ran folly unittests.

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D543099
Detect popcnt instruction at runtime, use it if available.

Summary:
If compiled for a popcnt-supporting target (-march=corei7, for example),
use __builtin_popcount, as it's presumably inlined.  Otherwise, detect
on startup (in the same way as glibc dispatches to one of the many
flavors of memcpy): GCC allows us to add a resolver function which the
dynamic loader will call on startup to resolve a function to one of
various alternatives; we check (using the cpuid instruction) whether
popcnt is supported, and use it if available.

Test Plan: tests added

Reviewed By: soren@fb.com

FB internal diff: D542977
Remove 1 instruction from popcount

Summary:
by removing the unnecessary constraint that the input and output be in
the same register (copypasta from https://phabricator.fb.com/D542718)

Test Plan: folly/test

Reviewed By: soren@fb.com

FB internal diff: D543310
Use gcc builtins instead of library functions for ffs*

Summary:
because, shockingly, glibc doesn't divert to the gcc builtins which are
inlined and fast

Test Plan: folly/test

Reviewed By: sding@fb.com

FB internal diff: D543363
Unbreak folly build on fedora / ubuntu

Test Plan: built

Reviewed By: delong.j@fb.com

FB internal diff: D543320
folly::dynamic: comment about std::vector const-iter erase issue

Test Plan: none

Reviewed By: delong.j@fb.com

FB internal diff: D543196
Add "short append" benchmark to fbstring benchmark suite.

Summary:
Appending many small strings to fbstring appears much slower (~3x) vs.
std::string. Adding benchmark case to illustrate.

[If this isn't wanted, I can revert]

Test Plan: This is a benchmark.

Reviewed By: soren@fb.com

FB internal diff: D544159