- 08 Feb, 2019 3 commits
-
-
Adam Simpkins authored
Summary: Move `FatalHelper.cpp` to the new folly/logging/test/helpers directory created in D13984692. Reviewed By: yfeldblum, dmaone Differential Revision: D13994517 fbshipit-source-id: e2b7e4b4f649fed5b882df47424d24e4fc4f717a
-
Adam Simpkins authored
Summary: Fix a problem where `LoggerDB::get()` could crash when called after `main()` has returned. The `LoggerDBSingleton` object may have been destroyed already, so calling `LoggerDBSingleton::getDB()` was not allowed. This updates the code to just store the singleton in a simple raw pointer, and only use the singleton helper object for flushing log handlers. Reviewed By: dmaone Differential Revision: D13984692 fbshipit-source-id: a0c8550af367458ca39fefa9090e3165ad6a82bb
-
Eric Niebler authored
Summary: Judging from the number of things that needed fixing, pushmi has been busted on gcc-5 for some time. Reviewed By: yfeldblum, kirkshoop Differential Revision: D13979146 fbshipit-source-id: 95def0ef6289b41e116a55359476ffec91787706
-
- 07 Feb, 2019 2 commits
-
-
Orvid King authored
Summary: It's not needed Reviewed By: yfeldblum Differential Revision: D13993615 fbshipit-source-id: 7e53224d39502b96e13bff352dab778df4782a1c
-
Yedidya Feldblum authored
Summary: [Folly] Fix `SingletonRelaxedCounter` in `T::~T()` of `ThreadLocal<T>`. Given a type `T` which has a dtor which increments some `SingletonRelaxedCounter`, and given some use of a `ThreadLocal<T>` where, within some given thread, the only time `SingletonRelaexCounter` is incremented is in the `T` dtor, there would be a leak of the `LocalLifetime` and this leak would cause subsequent `SingletonRelaxedCounter::count()` to segfault with access to a deallocated local counter. C++ `thread_local` destructors run before `pthread` thread-specific destructors. If a `pthread` thread-specific destructor triggers initialization of a C++ `thread_local`, then that `thread_local` will be leaked in that its destructor will never be run. Fix this with `ThreadLocal` by detecting when `ThreadLocal` per-thread destructors have begun running. This is a larger issue with `pthread` thread-specific objects overall, but as long as we stick to using `ThreadLocal`, it can be papered over. Reviewed By: davidtgoldblatt Differential Revision: D13970469 fbshipit-source-id: a4c7f36d2c0d63f8f0e363ddb9d35a44b027aea6
-
- 06 Feb, 2019 4 commits
-
-
Andrii Grynenko authored
Summary: Executor::KeepAlive<> is now implicitly constructible from Executor*. Reviewed By: capickett Differential Revision: D13954744 fbshipit-source-id: 523a860a337429a995152dc7171c0f6e8be8cecb
-
Lee Howes authored
Summary: Deprecate delayedUnsafe to stop people adding it to code. Reviewed By: yfeldblum Differential Revision: D13949215 fbshipit-source-id: ffc4eec113964a0b247f16f3c37f3f8c69fbb0df
-
Lee Howes authored
Summary: Update futures documentation for consistency with tag type changes. Reviewed By: yfeldblum Differential Revision: D13975003 fbshipit-source-id: 7015ffb8bd2b306e2dd31f6e2eb9e45b2618fa5f
-
Dan Melnic authored
Summary: Add support for microsecond timers Reviewed By: spalamarchuk Differential Revision: D13765262 fbshipit-source-id: ab5e2d876195a726dc654aee28cb40f695cf2277
-
- 05 Feb, 2019 3 commits
-
-
Chip Turner authored
Summary: Basic benchmarks to validate performance of similar string formatting functions. Notably, `stringPrintf` is always inferior to either format-based alternative. ``` ============================================================================ folly/test/StringBenchmark.cpp relative time/iter iters/s ============================================================================ libc_tolower 714.38ns 1.40M folly_toLowerAscii 66.03ns 15.14M stringPrintfOutputSize(1) 170.06ns 5.88M stringPrintfOutputSize(4) 198.54ns 5.04M stringPrintfOutputSize(16) 202.94ns 4.93M stringPrintfOutputSize(64) 204.82ns 4.88M stringPrintfOutputSize(256) 1.32us 759.95K stringPrintfOutputSize(1024) 4.47us 223.70K stringPrintfAppendfBenchmark 25.38ms 39.40 fmtOutputSize(1) 104.62ns 9.56M fmtOutputSize(4) 121.50ns 8.23M fmtOutputSize(16) 125.27ns 7.98M fmtOutputSize(64) 125.59ns 7.96M fmtOutputSize(256) 633.15ns 1.58M fmtOutputSize(1024) 1.06us 939.38K fmtAppendfBenchmark 8.22ms 121.71 follyFmtOutputSize(1) 122.76ns 8.15M follyFmtOutputSize(4) 149.51ns 6.69M follyFmtOutputSize(16) 148.90ns 6.72M follyFmtOutputSize(64) 147.45ns 6.78M follyFmtOutputSize(256) 150.71ns 6.64M follyFmtOutputSize(1024) 584.94ns 1.71M follyFmtAppendfBenchmark 11.39ms 87.79 BM_cEscape 321.10us 3.11K BM_cUnescape 290.97us 3.44K BM_uriEscape 2.99us 333.92K BM_uriUnescape 1.56us 639.36K BM_unhexlify 525.33ps 1.90G splitOnSingleChar 1.21us 823.13K splitOnSingleCharFixed 466.79ns 2.14M splitOnSingleCharFixedAllowExtra 0.00fs Infinity splitStr 1.86us 536.53K splitStrFixed 620.41ns 1.61M boost_splitOnSingleChar 2.34us 427.23K joinCharStr 947.58ns 1.06M joinStrStr 956.37ns 1.05M joinInt 2.24us 447.21K ============================================================================ ``` Reviewed By: vitaut Differential Revision: D13940303 fbshipit-source-id: a26d984cde26b1a5eb3eba1935722cdcd221fe44
-
Caleb Marchent authored
Summary: futures.h includes folly/python/executor_api.h, this header needs to be available to downstream projects (Thrift) which use python/futures.h. Pull Request resolved: https://github.com/facebook/folly/pull/1010 Reviewed By: Orvid Differential Revision: D13915880 Pulled By: calebmarchent fbshipit-source-id: 3c47fc4fe4ba425a4c12dcefd8980703765bdad5
-
Kyle Nekritz authored
Summary: We do not need this spammy logging. Reviewed By: siyengar, mingtaoy Differential Revision: D13950327 fbshipit-source-id: 6fc91d3efa27d2d88ab7571233ce04a6e28b15f7
-
- 02 Feb, 2019 1 commit
-
-
Stepan Palamarchuk authored
Summary: We're always scheduling negative timeouts to fire immediately. However, there's a branch with invalid timeout that may end up getting us into an invalid state (in particular, setting negative `expireTick_`). To avoid that, this adds input sanitization by making sure we don't have anything negative. Reviewed By: yfeldblum Differential Revision: D13934881 fbshipit-source-id: 28d7dc48f57da67d3266a7f33e058ff6994eb756
-
- 01 Feb, 2019 3 commits
-
-
Lee Howes authored
Summary: Fixes a missed r-value parameter case for exceptions passed to thenError continuations. Adds tests to separate l-value for onError from r-value from thenError. Reviewed By: yfeldblum Differential Revision: D13928271 fbshipit-source-id: 0a720730d32c158fb82b61dccd0426b1fe55169f
-
Orvid King authored
Summary: So that the fd overload can be removed. Reviewed By: yfeldblum Differential Revision: D13628683 fbshipit-source-id: 5201d3ef351042ebaf2d30c3987b931f8d13d336
-
Yedidya Feldblum authored
Summary: [Folly] `folly::chrono::abs`, backporting `std::chrono::abs`. Reviewed By: nbronson Differential Revision: D13584287 fbshipit-source-id: 92adbfcdac34d89674e6494af4ff3329d2f6974a
-
- 31 Jan, 2019 2 commits
-
-
Lara Lu authored
Summary: There is a need for KeepAlive copy constructor from various users. Adding them after chatting with Andrii. Background: move is preferred to copy as the latter does an atomic counter increment. `copy()` was introduced but there is a need for more user-friendly way of copying. TODO: maybe get rid of `copy()` and its usages? Reviewed By: andriigrynenko Differential Revision: D13864057 fbshipit-source-id: 38b2e45285566a3c2dba01706e82f421285b6bae
-
Caleb Marchent authored
Summary: Pull Request resolved: https://github.com/facebook/folly/pull/1006 Reviewed By: Orvid Differential Revision: D13782299 Pulled By: calebmarchent fbshipit-source-id: 7662c67a18c10a04d8d68e3f729da81c6df38336
-
- 30 Jan, 2019 3 commits
-
-
Shahzad Lone authored
Summary: Even though this is a test, we are still reallocating a vector (resizing until re-sized/reallocated to 32), which in theory calls for allocation 5 times. But we can save this by just reserving the vector pre-hand (we know the size). Pull Request resolved: https://github.com/facebook/folly/pull/998 Reviewed By: magedm Differential Revision: D13834292 Pulled By: yfeldblum fbshipit-source-id: 6b0d16ef0200184d10ba292a0b1d8d3afdadf56d
-
Alex Guzman authored
Summary: Adds functions for DH length to the compat library. Reviewed By: yfeldblum Differential Revision: D13584117 fbshipit-source-id: ef753d58ee400fbaf8d47f59b7d39e17380ed417
-
Yedidya Feldblum authored
Summary: [Folly] Apply `clang-format` to non-compliant locations (partial). (Note: this ignores all push blocking failures!) Reviewed By: igorsugak Differential Revision: D13858983 fbshipit-source-id: 668c3ee209456befd3c03d85945321143da2b00a
-
- 29 Jan, 2019 6 commits
-
-
Orvid King authored
Summary: They aren't needed Reviewed By: yfeldblum Differential Revision: D13855963 fbshipit-source-id: c822a4b806350ef178906401b2239a865fd77119
-
Orvid King authored
Summary: It was broken due to oddities with how MSVC handles expanding `##__VA_ARGS__` within the parameters to macros. Rather than deal with the pre-processor, just return the check to how it was and use `EXPECT_TRUE(false)` to achieve the same effect. Reviewed By: yfeldblum Differential Revision: D13850142 fbshipit-source-id: 887b39fb3c6072219c3f4748599bc7b707efbf25
-
Yedidya Feldblum authored
Summary: [Folly] SemiFuture::deferError and Future::thenError overloads taking exception-type-carrying tag to distinguish the exception type. Solves the case where `.deferError` or `.thenError` is called on an object with a dependent type, where passing the exception type otherwise requires the `template` keyword. Reviewed By: LeeHowes Differential Revision: D13855497 fbshipit-source-id: 74200853043e3fdbc08419b33b959f3519d704ef
-
Yedidya Feldblum authored
Summary: [Folly] A generic tag type for all your generic tag-related needs. With naming following the pattern of `std::in_place_t` and `std::in_place`. Reviewed By: kirkshoop Differential Revision: D13855499 fbshipit-source-id: 50b7e41fbbb843c6c9b766f8b66484d6aa23c167
-
Giuseppe Ottaviano authored
Summary: `value_before` looks like a pre-C++11 artifact, replace with `std::prev`. (Note: this ignores all push blocking failures!) Reviewed By: yfeldblum Differential Revision: D13852269 fbshipit-source-id: c2e4e8178754a694650f53633f099d05da4127d7
-
Giuseppe Ottaviano authored
Summary: Upgrade locks allow access concurrently with readers, so mutating the state under an upgrade lock can potentially introduce a race unless proven otherwise. The main goal of this diff is to make the accessors to `Synchronized` state `const` under upgrade lock, as it happens under a shared lock. To achieve so, the diff changes the mechanism by which `const` is added: instead of unconditionally closing a `const Synchronized` in the `LockedPtr`, it captures the same constness as the `Synchronized`, and then the `const` decision is done at access time. This enables having an extra method `asNonConstUnsafe()` that gives non-const access when needed without requiring a `const_cast`. This is now provided for shared locks as well. Reviewed By: yfeldblum, aary, davidtgoldblatt Differential Revision: D13817413 fbshipit-source-id: 8c315a925db9b1da8821984c59e55e90571b194e
-
- 28 Jan, 2019 2 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Apply `clang-format` to `folly/FBString.h`. A previous change was not properly formatted. Reviewed By: ot Differential Revision: D13831558 fbshipit-source-id: 318404a3a14d6969cc2aa9601e72fae6ad6cfac2
-
Lee Howes authored
Summary: Remove duplicate code from Future::onError and have it call Future::thenError. Reviewed By: yfeldblum Differential Revision: D13823960 fbshipit-source-id: d2e48e4e65e30c80adbbd70ff314e1a418b7c1e2
-
- 27 Jan, 2019 2 commits
-
-
Stepan Palamarchuk authored
Summary: As per Yedidya Feldblum comment on my previous diff, we need a duration cast in here. Reviewed By: yfeldblum Differential Revision: D13833032 fbshipit-source-id: 8819694875bd3a7e4f54102d8ac77490f8287fbb
-
Lee Howes authored
Summary: * Split thenError into future-returning and not-future-returning forms as we cannot rely on onError for this. * Move core functionality from onError into thenError to avoid thenError depending on onError. * Makes thenError's continuation consistent with other forms such that the parameter is passed by r-value, hence an l-value reference is no longer valid. Reviewed By: yfeldblum Differential Revision: D13820171 fbshipit-source-id: cf42a7d1c0759c5cfbb03f8e66a6d6988f7e10c7
-
- 26 Jan, 2019 2 commits
-
-
Wez Furlong authored
Summary: This makes it easier to debug and diagnose build problems Reviewed By: simpkins Differential Revision: D13831342 fbshipit-source-id: 3921a05715fb00264b2e1a6e134686d68aea804d
-
Yedidya Feldblum authored
Summary: [Folly] Cut various sites supporting MSVC <= 2015, which is insufficiently compatible. Reviewed By: Orvid Differential Revision: D13747631 fbshipit-source-id: 3d63d3a57258b5695b1236a81f3ddfe2f4af9cb4
-
- 25 Jan, 2019 6 commits
-
-
Jon Maltiel Swenson authored
Summary: Title. This gets rid of benign TSAN lock order inversion detections. (Note: this ignores all push blocking failures!) Reviewed By: spalamarchuk Differential Revision: D13820662 fbshipit-source-id: f092a988faa2cc897a1d046385e4bc4fd0422c7c
-
Dan Melnic authored
Summary: Add an HHWheelTimer-fwd.h header Reviewed By: djwatson Differential Revision: D13780411 fbshipit-source-id: 795352c3eeed38cd52a270ebdf5dd734604415fa
-
Wez Furlong authored
Summary: This should allow more direct testing of changes without waiting for things to land on github first. As part of this, to avoid a conflict between the deps that bistro downloads and those used by the rest of the fbcode builder CI, I've updated the version of gtest used by bistro. Reviewed By: zertosh Differential Revision: D13802637 fbshipit-source-id: fd71bfabd2a85f4f63c21b44a1e868f2d293180a
-
Andrii Grynenko authored
Summary: This is useful to avoid extra allocations when integrating with code that doesn't use folly::futures. Reviewed By: yfeldblum Differential Revision: D13812866 fbshipit-source-id: aa76b8cda43d1a781e058f6edbe2ecb8100268de
-
Wez Furlong authored
Summary: The headers are installed, but we weren't compiling the implementation. Reviewed By: simpkins Differential Revision: D13778568 fbshipit-source-id: 4d297b732d1e70bbd69100f13eb68f9477d7f014
-
Andrii Grynenko authored
Summary: This helps avoid executor re-schedule when Future is ready. Reviewed By: yfeldblum Differential Revision: D13805939 fbshipit-source-id: f553c7a581882a7b53b004fd6bbb5087ea5787f8
-
- 24 Jan, 2019 1 commit
-
-
Jon Maltiel Swenson authored
Summary: Currently, `runOnDestruction` aims to be thread-safe; new callbacks are added to the `onDestructionCallbacks_` list while the associated mutex is held. However, the caller may own the `LoopCallback` and wish to destroy/cancel it before the `EventBase` destructor runs, and this callback cancellation is not thread-safe, since unlinking does not happen under the lock protecting `onDestructionCallbacks_`. The primary motivation of this diff is to make on-destruction callback cancellation thread-safe; in particular, it is safe to cancel an on-destruction callback concurrently with `~EventBase()`. Reviewed By: spalamarchuk Differential Revision: D13440552 fbshipit-source-id: 65cee1e361d37647920baaad4490dd26b791315d
-