- 04 Oct, 2018 4 commits
-
-
Kenny Yu authored
Summary: This change is part of a bigger effort to make `folly::SharedMutex` compatible with TSAN so that TSAN can find lock inversions with these types of mutexes. In order to do this, we need to annotate the mutex function calls accordingly. The annotation functions are provided by the TSAN runtime library. Upcoming changes to `folly::SharedMutex`: 1. provide annotation helper macros (this change) 2. fix or suppress known issues in existing libraries (these macros will allow us to suppress issues) 3. once all the issues are fixed, annotate `SharedMutex` accordingly Reviewed By: nbronson Differential Revision: D9797582 fbshipit-source-id: 12306db98505fe31a8d8590113d10585840fbe6d
-
Nick Terrell authored
Summary: `AccessSpreader::cachedCurrent()` caches the result of `AccessSpreader::getcpuFunc()` for 32 calls in a thread-local. The cached function takes 2 ns, where the current call takes 12 ns. This comes at the cost of being imprecise when threads migrate to a new cpu. I chose 32 as the number of calls because it only has a 10% overhead over never refreshing (2.05 ns vs 1.83 ns), where 16 has a 30% overhead, and it performs just as well as 64. Reviewed By: ot Differential Revision: D10151009 fbshipit-source-id: 07ed292dfdcdcedcb74c24279f7773a80ad09348
-
Nick Terrell authored
Summary: * The atomic load was being optimized out of the benchmark. * The initializer wasn't being called for the test tags, so `AccessSpreader<ThreadLocalTag>::current()` and `AccessSpreader<PthreadSelfTag>::current()` were always returning 0. Reviewed By: ot Differential Revision: D10154155 fbshipit-source-id: 76be9865c9ee591d24aedc64e6faf4fd24350282
-
Neel Goyal authored
Summary: ALPN is the preferred way to do this. We should only use that and not provide NPN support anymore. Reviewed By: knekritz Differential Revision: D10110626 fbshipit-source-id: 5ec91fe51252bed0a8d8047e481df76a395e1286
-
- 03 Oct, 2018 1 commit
-
-
Saif Hasan authored
Summary: Two things - Use thenValue instead of then in one specific occurrence as later one has been deprecated - Build googletest on `release-1.8.1` as it is the one that compiles with c++11 Reviewed By: cenzhao Differential Revision: D10178139 fbshipit-source-id: 069578716e5e55ef0a25ea87e9ef5ceded1ff9d6
-
- 02 Oct, 2018 2 commits
-
-
Wez Furlong authored
Summary: There's no need for this to be inheritable Reviewed By: yfeldblum Differential Revision: D10139559 fbshipit-source-id: ae2db0d13e33c383fd73c0563b127e62e54a7094
-
Dan Melnic authored
Summary: Add IOBuf::takeOwnershipIov method Reviewed By: yfeldblum, djwatson Differential Revision: D10135962 fbshipit-source-id: 86a22d73aa1b72645640cf026d2dc2f38b02989c
-
- 01 Oct, 2018 4 commits
-
-
Amol Bhave authored
Summary: Use heterogenous lookup for dynamic::getDefault for StringPiece/dynamic keys. Reviewed By: shixiao Differential Revision: D10127452 fbshipit-source-id: 3cf28a28373211428ac5352136cf073e6c377b16
-
Amol Bhave authored
Summary: dynamic::setDefault already calls heterogenous `emplace(...)`, however it does not behave correctly for static constexpr strings. Add a specialization for StringPiece which solves this. The current set of tests does not invoke setDefault with an object as a key. This diffs adds a test that does that. Reviewed By: shixiao Differential Revision: D10007262 fbshipit-source-id: 386a44bf6b0a24f81e843695d177d85b280b907d
-
Nathan Bronson authored
Summary: Document that insert may evaluate its arguments after rehashing. Reviewed By: shixiao Differential Revision: D10132409 fbshipit-source-id: ba5996a309ae201ae08808272edd1fb0b981cc64
-
Petr Lapukhov authored
Summary: Consume `folly::dynamic` and if it matches JSON patch format, build a sequence of patch operations. Application is to be done separately, e.g. by a method of `folly::dynamic` by walking the operations vector (obtained after parsing the patch) and applying operations to the document. This mimics the approach we used previously with `folly::json_pointer`. Reviewed By: yfeldblum Differential Revision: D10017234 fbshipit-source-id: 1d0b9f0967e528b81abf7998c88abdaf70a2fce8
-
- 30 Sep, 2018 4 commits
-
-
Mark Williams authored
Summary: There are no other methods, and icc gets confused otherwise Reviewed By: yfeldblum Differential Revision: D10116562 fbshipit-source-id: 7664501b910e5857e32337d3583dcc948caddd5d
-
Mark Williams authored
Summary: icc doesn't support it. Reviewed By: yfeldblum Differential Revision: D10116547 fbshipit-source-id: 1ed522bd373ab30507f713d855ef02027ce90a91
-
Alexander Zhavnerchik authored
Summary: Having Indestructible field in SettingsCore makes it leak memory when threads die. Reviewed By: yfeldblum Differential Revision: D10118572 fbshipit-source-id: 68696983128049525018a911b03cb7ea8add53ab
-
Yedidya Feldblum authored
Summary: [Folly] Declare deleted `new` and `delete` operators in pairs in `ScopeGuard`. Reviewed By: Orvid Differential Revision: D10119848 fbshipit-source-id: 3588ed299248efd124d216bfaf5e472795f6a7aa
-
- 29 Sep, 2018 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Closer guarantee of `constexpr` Fingerprint tables computation. Works around a limitation that `template <...> constexpr` functions are only sometimes `constexpr` and may be non-`constexpr` for some instantiations with no warning by enforcing `constexpr` for the instantiations used. Differential Revision: D10116556 fbshipit-source-id: f7014e5b2fce411c27c331874a7fd33841e14df3
-
- 28 Sep, 2018 8 commits
-
-
Dan Melnic authored
Summary: This fixes a linker issue Reviewed By: tuomaspelkonen Differential Revision: D10109866 fbshipit-source-id: bf4193eafc8eb6f75b84241ff6e2ef89ef866642
-
Neel Goyal authored
Summary: SSL_CTX_new can fail if OpenSSL is not initialized. This ensures it is. Reviewed By: bolekk Differential Revision: D10105302 fbshipit-source-id: 4da40d4714747b0e6a359a52fa594fc29bb93c0a
-
Andrii Grynenko authored
Summary: Current thread was previously blocked waiting on the Future to be completed anyway, so there's no reason to not treat it like one of the ObserverManager threads (if it isn't one already) and run the computation inline. Without this change nested makeObserver calls could result in a deadlock if recursion depth was greater than the number of ObserverManager threads. Reviewed By: yfeldblum Differential Revision: D10097363 fbshipit-source-id: eb781ed5aea0ad9415da40fbc7f1c15ed481e92f
-
HC Zhu authored
Summary: This allows a caller to throw away unwanted parts e.g. ``` std::string user; folly::split('/', "ads_lla/admarket/adfox", std::ignore, user, std::ignore); ``` Reviewed By: yfeldblum Differential Revision: D10057247 fbshipit-source-id: 8198d4cb207bbd2007635db1e5796759dccf367c
-
Anton Likhtarov authored
Summary: SettingsMetadata provides a type-erased view, so the default value is stored as a string representation. This method allows getting the actual original default value. Differential Revision: D10077879 fbshipit-source-id: 2c6bf15eba57da5cb33ad1c657bc9bd51bcd2946
-
Anton Likhtarov authored
Summary: This forces users to take a Snapshot and makes global settings updates both atomic and more explicit. Differential Revision: D10055254 fbshipit-source-id: 73ce34acdadad19d5b75e74ad26f13dc7763228d
-
Anton Likhtarov authored
Summary: See the unit test for example usage. ``` folly::settings::Snapshot snapshot; // Now changes to `FOLLY_SETTING(project, name)` and `snapshot(FOLLY_SETTING(project, name))` // are independent from each other. // Any updates to the settings in the snapshot can be published via snapshot.publish() ``` Basic version with a global lock, there are ways to optimize this later. Differential Revision: D9926070 fbshipit-source-id: 66ee7f28539c242a08b688eab4a18e4a42a8b0ff
-
Yedidya Feldblum authored
Summary: [Folly] Various `noexcept` specifiers in `IOBuf`. Reviewed By: Orvid Differential Revision: D10081705 fbshipit-source-id: 5516e7deca4edd50ea99e61e10cd413f3c0f17ae
-
- 27 Sep, 2018 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Compute fingerprint tables at constexpr time, v.s. as a separate build step which generates a source file. Reviewed By: Orvid Differential Revision: D10081043 fbshipit-source-id: f01f7587aafd29fc1c44515730b759325e1566d8
-
- 26 Sep, 2018 4 commits
-
-
Teng Qin authored
Summary: Currently for `ElfFile::openNoThrow`, if `init` fails (due to mal-formatted content etc.) it won't unmap and close the file. They will only be unmapped / closed on destruction. This Diff calls `reset()` on that case. Reviewed By: yfeldblum Differential Revision: D9997690 fbshipit-source-id: c30907fb793c813a5ad40d249919dd1752a2d711
-
Jun Wu authored
Summary: The signal handler might use nearly 9KB stack for symbolization. That would cause stack overflow if the signal handler is running on a small alternative stack set by sigaltstack. We have seen that in Rust programs. The Rust stdlib sets up [8KB](https://github.com/rust-lang/libc/blob/4bd52f5e3ef5d6c8abdd1fbaf7c9975800a0dc93/src/unix/notbsd/linux/other/b64/x86_64.rs#L505) stacks [using sigaltstack](https://github.com/rust-lang/rust/blob/55b54a999bcdb0b1c1f42b6e1ae670beb0717086/src/libstd/sys/unix/stack_overflow.rs#L173) for all threads created by Rust on x64 Linux. Talked with jsgf, we'd still like to get a nice symbolized stack trace if segfault happens in a binary including both Rust and C++ code, since it's more likely the C++ part being wrong, so C++ symbol demangling is more important than Rust demangling. This diff detects the small sigaltstack case, then allocates larger stack for symbolization. Note the stack manipulation logic is not signal-safe, so it's not used for non-small-sigaltstack cases. Programs not using sigaltstack, or use sigaltstack with >9KB stacks won't be affected. As we're here, teach the signal handler to save and restore errno. Also add a note about golang's SA_ONSTACK requirement. Reviewed By: luciang Differential Revision: D9846902 fbshipit-source-id: f0dc81b1c1249d8a724e112906e0ff0b14c14ea9
-
Andrii Grynenko authored
Summary: This demonstrates a deadlock that's possible when using InlineTask. Reviewed By: lbrandy Differential Revision: D9883432 fbshipit-source-id: 45bb14181f6cfec41851315c0369232a30ba13d9
-
Neel Goyal authored
Summary: It seems like memdup may fail in certain builds with nullptr, 0 and cause OpenSSL to put a malloc failure on the stack. See https://github.com/openssl/openssl/blob/master/ssl/ssl_lib.c#L2752 This diff clears the error stack when we do this. Reviewed By: knekritz Differential Revision: D10037676 fbshipit-source-id: ea7b136cafde818564e8ee2401f0cef30f52a45d
-
- 25 Sep, 2018 4 commits
-
-
Andrii Grynenko authored
Summary: Because DeferredExecutor now acts as a simple proxy to user executor, we can actually support multi-hop SemiFutures. Reviewed By: LeeHowes Differential Revision: D9928793 fbshipit-source-id: c7e030bac3582b2931bc9639c766a4398ce23a76
-
Amol Bhave authored
Summary: This diff adds support for doing heterogenous lookups to the dynamic::get_ptr(dynamic) function. Reviewed By: yfeldblum Differential Revision: D10007208 fbshipit-source-id: 2453f3fe8ab36dfd9e5627aa75cf8eb7aee51699
-
Andrii Grynenko authored
Summary: Move the wait() and timed_wait() functionality out of DeferredExecutor. This is now possible because folly::Futures are using Executor::KeepAlive to manage executors' life-time. Reviewed By: LeeHowes Differential Revision: D9925417 fbshipit-source-id: e9818417048f44ee66648439e781060fdabca6b9
-
Alexey Kozhevnikov authored
Summary: MSVC (14.12.25827, VS 2017 15.5) fails to compile with internal error when using `/std:c++14` parameter: ``` Future-inl.h(1484): fatal error C1001: An internal error has occurred in the compiler. (compiler file 'msc1.cpp', line 1507) To work around this problem, try simplifying or changing the program near the locations listed above. ``` Reviewed By: yfeldblum, Orvid Differential Revision: D10018915 fbshipit-source-id: ba886265b68684aacc2bf471c79ba6c39e611c8e
-
- 24 Sep, 2018 4 commits
-
-
Philip Pronin authored
Summary: If `Source` isn't copyable, parallel generator cannot be composed further due to implicitly deleted move ctor. Example: ``` byLines(File(...)) | parallel(map(...)) | sum; ``` Reviewed By: ddrcoder, ot Differential Revision: D10004477 fbshipit-source-id: 51ce23e834413bd53547a683f8ed89a1811f74a2
-
Amol Bhave authored
Summary: Some of the error messages had the incorrect expected types. Fix those occurences Reviewed By: shixiao Differential Revision: D10003775 fbshipit-source-id: ba8e3b7d14ee2c5442dfd24b9fbf7775d601f6f0
-
Lee Howes authored
Summary: Deprecate the legacy forms of Future::then to assist migration to thenValue and thenTry. This is part of a longer process to improve type correctness for folly::Future. By separating the forms of then we no longer have ambiguity when passing a polymorphic lambda as a continuation and can more easily tweak the implementation to modernise it. Reviewed By: yfeldblum, WillerZ Differential Revision: D9974379 fbshipit-source-id: 26f986329cb5d2d33d366b8f9e7b2664656642ff
-
Amol Bhave authored
Summary: Add implementation for std::hash<MacAddress> so that it can be used in maps. Reviewed By: yfeldblum Differential Revision: D10004544 fbshipit-source-id: 46cb177577123b1248cd8ff679f0fbe286596819
-
- 22 Sep, 2018 3 commits
-
-
Lee Howes authored
Summary: To allow deprecation, remove use cases of Future::then inside FutureSplitter.h Reviewed By: yfeldblum Differential Revision: D9995264 fbshipit-source-id: d44c63c45a08ca675b9bff33fabcbb2836ea2a64
-
Lee Howes authored
Summary: Went a step too far removing then from inside Future-inl.h. Map needs to be generic over value/try. Just remove that change for now. Reviewed By: yfeldblum Differential Revision: D10002565 fbshipit-source-id: c37f744d47f9dd123114b6b62c1c832519cb4f8e
-
Yedidya Feldblum authored
Summary: [Folly] A faster `empty()` shortcut in `IOBufCompare`. Reviewed By: spalamarchuk Differential Revision: D9981606 fbshipit-source-id: 4a9762b83fe2f26b1387c162a1e23c201088977f
-