(wangle) fix shadow

Summary: Not sure why this shadow error didn't turn up in my tests, but whatevs

Test Plan: traffic manager builds without warning-errors

Reviewed By: suhas@fb.com

Subscribers: hannesr, net-systems@, fugalh, exa

FB internal diff: D1421495

Tasks: 4653938
Move the branchless, parallel ASCII toLower into folly

Summary:
* Moved the fast toLower code into folly
* Updated the name to emphasize that it's ASCII-only

Test Plan: * Unit tests and benchmarks included.

Reviewed By: tudorb@fb.com

Subscribers: ruibalp, bmatheny

FB internal diff: D1421056
stride()

Summary: thatwaseasy

Test Plan: iloveunittests

Reviewed By: lucian@fb.com

Subscribers: philipp

FB internal diff: D1419848

Tasks: 4636617
Use pipe2 in Subprocess; platform-specific config

Summary:
We've wanted to use pipe2 in Subprocess for a while, but that's not supported
on glibc 2.5.1. This is not a problem in OSS (autoconf can solve this),
but, internally, we don't run autoconf; add an internal platform include file
with such per-platform differences.

Test Plan: fbconfig -r folly && fbmake runtests_opt

Reviewed By: meyering@fb.com

Subscribers: jhj, lesha, kma, agallagher

FB internal diff: D1422128
Fix libc++ build errors

Summary:
Reported externally:

https://github.com/facebook/folly/issues/70
https://github.com/facebook/folly/issues/71
https://github.com/facebook/folly/issues/72
https://github.com/facebook/folly/issues/73

Note that I can't test on libc++ myself, but the reports suggested fixes which
sounded good.

Test Plan: fbconfig -r folly && fbmake runtests_opt

Reviewed By: marcelo.juchem@fb.com

Subscribers: jhj, ntv, lesha, kma, fugalh, jdelong

FB internal diff: D1421029
make `folly::Formatter` extendible

Summary:
on advice of @tudorb, move most of `folly::Formatter` into `folly::BaseFormatter` so that we can use compile-time polymorphism to provide different types of Formatters.

I wasn't able to get the recursive formatter to be polymorphic -- whenever I tried to convert `class FormatValue<Formatter<containerMode, Args...>, void>` into `class FormatValue<BaseFormatter...`, `FormatTest.cpp:Test(Format, Nested)` wouldn't compile because it couldn't find the template. @tudorb, if you have an easy fix for this, lmk, otherwise I'm (reluctantly) okay with requiring that `Formatter`s define their own nesting `FormatValue`.

phew. the last time I did this sort of metaprogramming was over 5 years ago in perl. Doing it in C++ is... interesting.

Test Plan: `fbconfig -r thrift folly cold_storage && fbmake dbg && fbmake runtests`

Reviewed By: tudorb@fb.com

Subscribers: tudorb, dgp

FB internal diff: D1422343

Tasks: 4624268
Revert "make `folly::Formatter` extendible"

Summary:
This reverts commit 5ea0eb0c705224b82a5c284dc5f7722e1f71199f.

This breaks the HHVM clang build test.

Test Plan: clang will pass now

Reviewed By: smith@fb.com

Subscribers: dmitrys

FB internal diff: D1426399

Tasks: 4667712
Simplify pipe2 / O_CLOEXEC handling in Subprocess.cpp

Summary: per @rockyliu's suggestions

Test Plan: subprocess_test

Reviewed By: rockyliu4@fb.com

Subscribers: rockyliu, jhj, lesha, kma

FB internal diff: D1423157
Fix race in Notification Queue

Summary: When we are changing value of numActiveConsumers_ with setActive from handlerReady at the SCOPE_EXIT we have a race with reading of the same variable in putMessageImpl.

Test Plan: Had a local race which works fine now.

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent

FB internal diff: D1424674
Remove unnecessary and broken hash specializations

Summary:
No need to specialize std::hash for std::basic_string; the STL already does
this. Plus, the specializations were broken in multiple ways:

1. std::hash does not treat const char* specially, so it just hashes the
pointer value (contrasting the old __gnu_cxx::hash, which hashed a C-string)

2. Either way, using __gnu_cxx::hash<const char*> for std::string is broken,
as it won't hash anything past the first null byte.

Also, make sure fbstring gets the same (full) specializations as std::string
does in the standard.

Test Plan: fbconfig -r folly && fbmake runtests_opt, also tests in tupperware/agent which is still using __gnu_cxx::hash_map with string keys.

Reviewed By: pgriess@fb.com, andrei.alexandrescu@fb.com

Subscribers: njormrod, jhj, kma, lesha

FB internal diff: D1426479