- 14 Dec, 2016 3 commits
-
-
Nathan Bronson authored
Summary: A recent diff added [[noreturn]] annotations that cause buck build to fail for ExceptionTracerTest.cpp, due to our use of -Werror and -Wunreachable-code-return. This diff removes the unreachable return statement. Differential Revision: D4326888 fbshipit-source-id: 7863c163eedcf2a7e19730c1de194f05c544a2c0
-
Christopher Dykes authored
Summary: If your function doesn't return you should be explicit about it. Reviewed By: meyering Differential Revision: D4309893 fbshipit-source-id: ce275ec8f42e2cb3253a1e40e263934649f09d9e
-
Andrii Grynenko authored
Reviewed By: yfeldblum Differential Revision: D4323918 fbshipit-source-id: 8dcd4ef3629fff061a9f149093ef1fe087f1c7e2
-
- 13 Dec, 2016 6 commits
-
-
Michael Lee authored
Summary: Find and remove a couple of unnecessary includes Reviewed By: matbd Differential Revision: D4322316 fbshipit-source-id: 7b55119bd7566fd62762ace5e35aa536489fafad
-
Andrii Grynenko authored
Reviewed By: igorsugak Differential Revision: D4320762 fbshipit-source-id: 2028de6ccc6fb129381b03d694b88677a5aa50d6
-
Neel Goyal authored
Summary: Allow observers to be notified when AsyncSocket attaches and detaches from EVB Reviewed By: siyengar Differential Revision: D4256175 fbshipit-source-id: a3ff96811f885e508f20cf11ce52e0f00e5ee461
-
Christopher Dykes authored
Summary: The most common place this happened was in tests where it was being used to force the return type of a lambda, but there were a couple of places in the main code that triggered this as well. Reviewed By: yfeldblum Differential Revision: D4310187 fbshipit-source-id: e3701cff9827eacaf3be8d28296441466eb2fa11
-
Philip Pronin authored
Summary: Moving russoue's `JemallocNodumpAllocator` (D3147173) from `mcrouter` codebase to `folly`, so we can use it in a few other services that suffer from a huge core dump problem. Reviewed By: russoue, jmswen, luciang Differential Revision: D4311394 fbshipit-source-id: 6a13c478b939bd411e0fd37e655125f62434c366
-
Igor Zinkovsky authored
Summary: Adding new `addFunctionOnce` method that executes provided callback only once. Reviewed By: yfeldblum Differential Revision: D4315635 fbshipit-source-id: 4819ec30b4f2e4ab3185a37158404e1c7a96758a
-
- 12 Dec, 2016 4 commits
-
-
Christopher Dykes authored
Summary: Prior to C++14 these shifts are undefined behavior, but the unsigned version is not, so do the shifts on unsigned values before converting to the final type. Reviewed By: yfeldblum Differential Revision: D4309311 fbshipit-source-id: 914b207bac2f77a96c07a8a5df81980c672aa677
-
Christopher Dykes authored
Summary: Which warns about the use of a ternary statement with the first operand omitted. This is a GCC extension and MSVC does not support it, so eliminate the last use of it. Reviewed By: yfeldblum Differential Revision: D4309989 fbshipit-source-id: 04c968708e47f8cb707fd0892e8780bc676df0de
-
Christopher Dykes authored
Summary: They aren't needed and they count as initialized but unused variables. Reviewed By: yfeldblum Differential Revision: D4308844 fbshipit-source-id: a6833dbf434ebdefff0b375729a4e62495463ac0
-
Christopher Dykes authored
Summary: Split out of an earlier pair of diffs, this focuses exclusively on Folly's networking APIs and works to eliminate places where values were being implicitly truncated. Reviewed By: yfeldblum Differential Revision: D4288042 fbshipit-source-id: dd6e19acd319296a45c29c8050dc62f06571e1e6
-
- 10 Dec, 2016 2 commits
-
-
Christopher Dykes authored
Summary: Because the `break;` can be dead, and sometimes is indicitive of a different type of error. Reviewed By: meyering Differential Revision: D4310056 fbshipit-source-id: ad215eb9b2e5bb4d5c703582203efce893b26a76
-
Kyle Nekritz authored
Summary: To monitor client support of TLS 1.3. Reviewed By: ngoyal Differential Revision: D4308473 fbshipit-source-id: cb6fb444c8b7ced39e6655a0f63b18523c2fb9c5
-
- 09 Dec, 2016 6 commits
-
-
Nathan Bronson authored
Summary: In AsyncSSLSocket tests the shared_ptr structure means that the AsyncSSLSocket-s outlive the stack-allocated EventBase on which they were created. Previously there were scattered calls to detachEventBase on the last interesting callback, but several calls were missing. This diff switches to a model where the SSLServerAcceptCallbackBase is responsible for detaching the sockets. This diff also fixes a low-firing race between shutdown of the TestSSLAsyncCacheServer Main thread and a call to EmptyReadCallback::readEOF. Most uses of EmptyReadCallback don't attach the TCP socket, so they can't actually tolerate a call to readError or readEOF. These use-after-destruction problems were discovered by UBSAN. Reviewed By: djwatson Differential Revision: D4301416 fbshipit-source-id: 127fb5e506d0694c5ca81d7a38c704d69f4ab3eb
-
Christopher Dykes authored
Summary: Because the extra semicolons are useless and all typos... GCC doesn't have this warning. Neither does MSVC, but that won't stop me. Reviewed By: igorsugak Differential Revision: D4304218 fbshipit-source-id: a06586edc6b9bafd5dd074e9fd4e0ed152181abc
-
Christopher Dykes authored
Summary: This accounts for the places that were triggering warnings 4456, 4457, and 4458, which are all related to shadowing names, be they locals, parameters, or even types. This doesn't deal with 4459, which is specifically for shadowing global variables, because folly/gen defines globals by the name of `count`, `min`, `max` and a few other similar names. Reviewed By: meyering Differential Revision: D4296781 fbshipit-source-id: a2e625095e2c65a53a9226b000aaf0ca95a3a393
-
David Goldblatt authored
Summary: Do the barrier completion test in a loop. (std::condition_variable has pthreads-style spurious wakeups). (Sorry for missing this in review). Reviewed By: djwatson Differential Revision: D4302035 fbshipit-source-id: 3322d6a0ffba8c47c46bafb1d88034e1a0a9c652
-
Dave Watson authored
Summary: Add fairness benchmark, contended benchmark Reviewed By: davidtgoldblatt Differential Revision: D3706680 fbshipit-source-id: 01814fcd6b0cc3dd12815a2b2c248abc6a3771ec
-
Qinfan Wu authored
Summary: It deletes things even when input isn't in the container. Reviewed By: luciang Differential Revision: D4298340 fbshipit-source-id: 3e8fc04c2c21eb231dcaf82239ac5f6d25e49e2c
-
- 07 Dec, 2016 9 commits
-
-
David Lam authored
Summary: `condition_variable::wait_for` takes as second param `std::chrono::duration` and not a predicate; what we want is `condition_variable::wait`. Reviewed By: simpkins Differential Revision: D4295305 fbshipit-source-id: 05f735fe6e7ecb9d8f42cb38a2985b9ce9dad984
-
Christopher Dykes authored
Summary: MSVC has the ability to warn about implicit truncations and places where implicit sign coercions are occuring, so do some cleanup to make it possible to compile with the warnings enabled. Reviewed By: yfeldblum Differential Revision: D4288028 fbshipit-source-id: f8330c62b2dcb76f696dfc47888f0e3e1eefc21a
-
Yedidya Feldblum authored
Summary: [Folly] Cut some includes from `Executor.h`. Reviewed By: mzlee Differential Revision: D4256618 fbshipit-source-id: 1728f48b3c0ec4e0c4c84c44bd8afb583d438129
-
Wez Furlong authored
Summary: Nothing defines USE_JEMALLOC in the OSS build today and that causes some portability problems. Specifically, the homebrew recipe will make libjemalloc available and our configure script will detect it and add it to the library flags. Our subsequent check for `malloc_usable_size` then finds this function in libjemalloc. When later attempting to build wangle against the homebrew folly we get compilation failures because the prototype for `malloc_usable_size` is only available in the jemalloc headers and nothing in the saved configuration for folly is set up for this to be pulled in as it it guarded by `USE_JEMALLOC`. This attempts to resolve the situation by forcing on `USE_JEMALLOC` when we detect the library in configure. This is made a little more complicated because we cannot set `USE_JEMALLOC` in the OSS build; it gets rewritten to have a `FOLLY_` prefix. Since we have code outside of folly that requires that this symbol be `USE_JEMALLOC`, I've changed the conditional to check for both flavors of the symbol, with and without the prefix. Reviewed By: yfeldblum Differential Revision: D4289176 fbshipit-source-id: 756bc815c3ef1fac454e603feb72155d98c5aadd
-
Eric Niebler authored
Summary: Inspired by http://wg21.link/p0259, folly::BasicFixedString is a std::string replacement that is usable in constexpr contexts. It uses an internal fixed-size buffer to store up to N characters, where N is a template parameter. Reviewed By: luciang Differential Revision: D4249529 fbshipit-source-id: 10f12ea2510a8d21ec60a07a8f15ecc3e35c5431
-
Christopher Dykes authored
Summary: `stdin`, `stdout` and `stderr` are macros that expand to function calls with the MSVC CRT implementation. This is also the case for musl-libc. This means that Subprocess simply cannot be compiled on those platforms without changing the API. To solve that, we change the API and deprecate the old API. For more fun, `stdin`, `stdout` and `stderr` are also macros in glibc, they just expand to other identifiers rather than a function call. Reviewed By: yfeldblum Differential Revision: D4229544 fbshipit-source-id: 97f1a3b228b83cfdcaffee56d729063ea235e608
-
Nathan Bronson authored
Summary: Fix use-after-destroy of NewThreadExecutor. Detected by opt-ubsan tests. Reviewed By: yfeldblum Differential Revision: D4291900 fbshipit-source-id: 206f1d7b80fa04e1570e4b7a20e50b9a8ceb7bcb
-
Nathan Bronson authored
Summary: Freshly opened TCP sockets can have a send buffer size bigger than wmem_default, because connection parameters are cached in the route cache. Some of the async socket tests assumed that writing 8M of data was enough to guarantee blocking behavior, but since wmem_max is 20M on our systems the resulting tests are flaky. Reviewed By: marcinpe Differential Revision: D4292201 fbshipit-source-id: ba5d606d080330e455eee2b17bcae6cf546bf981
-
Dan Schatzberg authored
Summary: Add the default move constructor and move operator to EvictingCacheMap so it can be moved. Reviewed By: markisaa, luciang Differential Revision: D4287472 fbshipit-source-id: 130e9d5467d6da14ba95a9e769cf8e8d541a704c
-
- 06 Dec, 2016 5 commits
-
-
Andrii Grynenko authored
Summary: UBSAN instrumentation results in more stack being used. Applying the same logic we already have for ASAN there. Reviewed By: igorsugak Differential Revision: D4287455 fbshipit-source-id: 1a224cb5a3654c23b15fa298bf80476234a1418c
-
Michael Lee authored
Summary: MacAddress only needs to include ostream and the test header does not need iostream. Differential Revision: D4286405 fbshipit-source-id: e64fdd4e8428c62279ed7c185188f3dfc14096d3
-
Michael Lee authored
Summary: We do not need it and it adds a static initialization This is the last extra one in liger. The other places actually need iostream to print things Reviewed By: yfeldblum Differential Revision: D4286095 fbshipit-source-id: 44a827e48e9fb9106626e784592eb194dff83bf6
-
Christopher Dykes authored
Summary: The benchmark API only supports `unsigned int` as the iteration number, so this being 64-bit means it has to be truncated for no reason. This change gets us closer to being able to enable MSVC's implicit truncation warnings. Reviewed By: yfeldblum Differential Revision: D4281264 fbshipit-source-id: 27397e3f23bace20f3cc457665ea6f21bf994da5
-
Misha Shneerson authored
Summary: I was getting an error when running commands in https://our.intern.facebook.com/intern/dex/fibers/gdb/ Reviewed By: andriigrynenko Differential Revision: D4283229 fbshipit-source-id: fe45847d0ec6cadfbce6fe9818066cce3e275a46
-
- 05 Dec, 2016 2 commits
-
-
Eric Niebler authored
Summary: overload constexpr_strlen to work with other character types Reviewed By: yfeldblum, luciang, Orvid, ot Differential Revision: D4269654 fbshipit-source-id: 2fcd666669efb51d77e847ff31bda3a301e763da
-
Eric Niebler authored
Reformulate constexpr_min and constexpr_max to achieve stability in sorting as described in http://stepanovpapers.com/notes.pdf Summary: There is a famous long-standing "bug" in the standard library regarding the semantics of min and max wrt values that are equivalent wrt op< but not equal. Let's not make the same mistake with constexpr_min and constexpr_max. Reviewed By: yfeldblum, luciang, Orvid, ot Differential Revision: D4269635 fbshipit-source-id: 19b464c949dc0cf07afb08eaf657ae8b242ca42d
-
- 04 Dec, 2016 1 commit
-
-
Amir Shalem authored
Summary: Fix potential double close() on exception when SO_REUSEPORT fails. The fd will be closed twice, once by close() and second by the scope guard above. Reviewed By: yfeldblum Differential Revision: D4272300 fbshipit-source-id: a163be822d7522cadb9dc3c3eddca10df453de14
-
- 03 Dec, 2016 1 commit
-
-
Christopher Dykes authored
Summary: MSVC was getting thoroughly confused while trying to eval the constexpr function, so switch it to a template instead. MSVC was also failing to wrap it's head around what a NodeRecycler is, so delay its resolution via typename. Reviewed By: yfeldblum Differential Revision: D3478755 fbshipit-source-id: f687f4538fb12ef8eee525557f4cc988a09e714d
-
- 02 Dec, 2016 1 commit
-
-
Christopher Dykes authored
Summary: This makes the changes required to allow folly to compile cleanly with the sign/unsigned mismatch warnings 4388 and 4389, as well as with warnings 4804 and 4805, which are about comparisons between scalars and bool. Most of the changes in this are to `DCHECK_*` calls which are translated to a templated call which does the comparison internally based on the inferred type of the argument, which for a literal `0` is `int`, causing the warnings to get generated when the comparison is done. Reviewed By: yfeldblum Differential Revision: D4253427 fbshipit-source-id: cd17973a78e948a62c886a2959f9abf40a69f9f5
-