- 23 Feb, 2021 2 commits
-
-
Yedidya Feldblum authored
Summary: Use `std::filesystem` or `std::experimental::filesystem`, via `folly/portability/Filesystem.h`, in `folly/test/FileTest.cpp`. Replaces the use of `boost::filesystem`. Reviewed By: Orvid Differential Revision: D26572916 fbshipit-source-id: f769e00b2772f3bfaed899f5694d89db87089e35
-
Yedidya Feldblum authored
Summary: Make the implementation of `folly::fs::lexically_normal` match C++17 `std::filesystem::path::lexically_normal`. The implementation from `boost::filesystem::path::lexically_normal` is easy to fall back on but has some differences. The implementation is copied mutatis mutandis from https://github.com/gulrak/filesystem/ at tag v1.5.0, in which `ghc::filesystem` is a complete portable standalone implementation of the `std::filesystem` spec and released under the MIT license. Reviewed By: Orvid Differential Revision: D26572520 fbshipit-source-id: 5ce03f37c078ee4f62e3480d4abc259199867c8e
-
- 22 Feb, 2021 5 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Prefer to nest helper functions in coro tests within the specific tests which use them. Reviewed By: ispeters, Orvid Differential Revision: D20324066 fbshipit-source-id: 4134145c406f2d1fdeaddf9a7d244c1bd25ec60b
-
Yedidya Feldblum authored
Summary: Some versions of gcc miscompile the code in the parallel-map exception test. Work around the miscompile by adding an extra log line. Reviewed By: Orvid Differential Revision: D26509079 fbshipit-source-id: 1474437d96aeabad0294bcb395b7baec229eb9ba
-
Yedidya Feldblum authored
Summary: The CMake function `check_cxx_compiler_flag` is snake-case rather than uppercase. Reviewed By: vitaut Differential Revision: D26573998 fbshipit-source-id: 91d5e2cea933d35967d013b2344e50f52fb6ba77
-
Yedidya Feldblum authored
Summary: Tweak a test that relies on hardcoding the expected result of `std::exception().what()` instead to call that and use the result without hardcoding it. Differential Revision: D26573226 fbshipit-source-id: 3802d12186c96b864e2680d99f5cfca185235f8d
-
Misha Shneerson authored
Reviewed By: andriigrynenko Differential Revision: D26572552 fbshipit-source-id: 035e1313cd4dec070555b5cd41efc58a0b4a948a
-
- 20 Feb, 2021 4 commits
-
-
Yedidya Feldblum authored
Summary: Revise `EventBaseLocal` interface to export the suite `emplace`, `try_emplace`, `emplace_with`, and `try_emplace_with`, and adding initializer-list overloads for completeness. This mirrors the interface of `DelayedInit`. Differential Revision: D26262870 fbshipit-source-id: 951e2f781a1b5546d96adb2e77aa1cadfbff2d6b
-
Yair Gottdenker authored
Reviewed By: yfeldblum Differential Revision: D25514804 fbshipit-source-id: 7e6ad5c6063d2cf5047f656c0f2336b34576c60b
-
Andrii Grynenko authored
Summary: EventBaseLoopController does this already. This way it's safe to destroy FiberManager even if some local callback is left in the executor. Differential Revision: D26563934 fbshipit-source-id: 0845e5c532634fa9c53694cd67e983886cea82de
-
Yedidya Feldblum authored
Summary: A portability header for `<filesystem>` backed up by `<experimental/filesystem>`. The only thing it does is figure out the right header to include and the right namespace to import so that folly code which already may assume C++17 can use names via `folly::fs`. And polyfills `lexically_normal`. Reviewed By: Orvid Differential Revision: D26453988 fbshipit-source-id: 7a7b2e7a312f5d0438d60bc866b109240d096520
-
- 19 Feb, 2021 7 commits
-
-
Robin Cheng authored
Summary: Technically speaking the contract of isRunning() is unclear on whether it can be used as a synchronization mechanism; it could, e.g. be used solely for diagnostics purposes, in which case memory_order_relaxed would be enough. But it is used at least to implement waitUntilRunning(), so memory_order_acquire/memory_order_release is needed to achieve proper synchronization. Reviewed By: yfeldblum Differential Revision: D26436697 fbshipit-source-id: 2be07c473e1cb286e6044fa677304816921e888d
-
Nick Terrell authored
Summary: Currently, the first thing you want to do when getting a context from the pool is reset it, because you don't know the state the last user left it in. This is bug prone, because you may forget to reset the context. Instead, the pool should handle the resetting logic, so it cannot be forgotten. This diff adds a `Resetter` to the pool, and the reset function is called every time a context is returned to the pool. I chose to reset when returning to the pool instead of when retrieving a context because that gives the context a chance to free any resources it doesn't expect to need in the future before it potentially becomres idle. Reviewed By: Cyan4973 Differential Revision: D26439710 fbshipit-source-id: 8b9afa3db2fda4d167f0fd5307791e8a8a4f283c
-
Nick Terrell authored
Summary: We already cache the contexts in the context pool. We don't also need to cache the contexts in the `Codec` when the user keeps the codec around. This will allow us to better utilize the contexts, and potentially reduce memory usage. Reviewed By: felixhandte Differential Revision: D26356275 fbshipit-source-id: 6d80326f469de61094478c73b6fe557eebcd7a22
-
Yedidya Feldblum authored
Summary: Mark the param to `folly::type_info_of` param as `[[maybe_unused]]` since, when RTTI is unavailable, it is unused. Differential Revision: D26537864 fbshipit-source-id: 3fd0a1bb0d3ecbbcdc5e07f153e321a0b8537478
-
Yedidya Feldblum authored
Summary: Let `FOLLY_MAYBE_UNUSED` which wraps `[[maybe_unused]]` support MSVC even when the latter misreports `__cplusplus`. Differential Revision: D26537706 fbshipit-source-id: 37554b7f9d27332088b72de41e53a5b85ef46327
-
Yedidya Feldblum authored
Summary: This permits removal of the `_getptd()`-based implementation of `folly::uncaught_exceptions` sometimes used on windows, in favor of forwarding to `std::uncaught_exceptions`. Reviewed By: akrieger Differential Revision: D26509011 fbshipit-source-id: b8fd14df91fcd849420d3c52328cb080b528245b
-
Misha Shneerson authored
Reviewed By: andriigrynenko Differential Revision: D26497717 fbshipit-source-id: 35307fce7f9e85882f8f9e5a6bdfe651122727a3
-
- 18 Feb, 2021 5 commits
-
-
Yedidya Feldblum authored
Summary: Ensure all the tests in `folly/lang/test/` are in the cmake build. For disambiguation, prefix them all with `lang_`. Reviewed By: Orvid Differential Revision: D26496837 fbshipit-source-id: 185a7990c2c7f535123229a07436e901dca6ae7f
-
Orvid King authored
Summary: This returns a char* so correct return is nullptr, not 0. Reviewed By: usikder Differential Revision: D26122982 fbshipit-source-id: 8c62520403fce966f83939be7cc03f6dc6be4aee
-
Yedidya Feldblum authored
Summary: Cut log lines in `folly::uncaught_exceptions` test cases. Having log lines is helpful when debugging test failures but we can always add them in when necessary. This makes running the test binary directly less noisy, and running test binaries directly is an important case not to be overlooked. Reviewed By: markisaa Differential Revision: D26504200 fbshipit-source-id: 00e06e1396b9ccc9cdd739ace1007726ebaa3d88
-
Yedidya Feldblum authored
Summary: A show-build-dir subcommand. Possibly useful for building a project and then running only one test or benchmark binary directly. Reviewed By: wez Differential Revision: D26502869 fbshipit-source-id: 0d8f6c42a2bbeb2440503a39c7fc770e3b3e4fff
-
Yedidya Feldblum authored
Summary: Cut `std::hash` specialization in folly for `signed __int128` and `unsigned __int128`. There are cases where folly does polyfill things in the global and standard namespaces, but in order for folly to play nicely with other libraries this practice is overall to be avoided. Reviewed By: nlutsenko Differential Revision: D26455137 fbshipit-source-id: 948140513b8daf6fe777d04ea42346d69c5eb03f
-
- 17 Feb, 2021 4 commits
-
-
Yedidya Feldblum authored
Summary: Avoid the use of fancy macros in the `folly::enumerate` test suite in order to facilitate cmake's gtest integration. Reviewed By: Orvid Differential Revision: D26477530 fbshipit-source-id: 1838709e76016c389b052a9523a0681c58b8af96
-
Yedidya Feldblum authored
Summary: Cut the `EventBaseLocal::emplace` overload taking a pointer since it is unused and to consolidate on the approach of not letting internals leak. Differential Revision: D26246689 fbshipit-source-id: 0d9dc1bfcc3d37dc980142b221ee4443b98205a3
-
Lee Howes authored
Summary: Use the global immutable executor by default and remove the default entirely for the deprecated form. Reviewed By: yfeldblum Differential Revision: D26414638 fbshipit-source-id: b48fe4683165e7f29e8003560f2917e143138bb0
-
Yedidya Feldblum authored
Summary: Let `File` tests not use `/etc/hosts` since that file is not portable across all systems. Likewise the fs-util tests using `/usr/lib` and `/usr/bin`. Reviewed By: chadaustin Differential Revision: D26447117 fbshipit-source-id: 669a3d7e0ea4efd54ca2efd5c15d8a21227b5c8c
-
- 16 Feb, 2021 2 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Let some utility functions be invocable objects: `to_signed`, `to_unsigned`, `to_narrow`, `to_underlying`. Additionally, force the template type param to be deduced. Reviewed By: markisaa Differential Revision: D21959729 fbshipit-source-id: eedd9f2f84efb62c99ed0d5f65123a7fe000cf0a
-
Lior Israeli authored
Summary: Currently there is logic that keeps histograms which only have one value reported to it separately. The multi level histogram keeps the histogram for several time buckets. Just in case we had only one value added, it will keep reporting the value even if it was reported long ago and shouldn't appear in the time window level we are querying. This is inconsistent with non histogram metrics (`avg` for example) reported from the same histogram, which don't have this logic. A scenario would look like this: 1. Report value 5 to histogram 2. Immediately query the 60 second level -> `avg` reports 5, `p50` reports 5. 3. Wait 2 minutes 4. look at the 60 second level -> `avg` reports 0 (no value in the last 60 seconds) but `p50` keeps reporting 5. I think this does more harm than good, so I suggest to kill this behavior. Reviewed By: simpkins Differential Revision: D26339016 fbshipit-source-id: 120485f8b78876e60ce66a534edcf86e7d9a836d
-
- 14 Feb, 2021 4 commits
-
-
Yedidya Feldblum authored
Summary: [folly] no `shared_ptr` storage in `EventBaseLocal` since its refcount operations are unnecessary. Pare it down to `unique_ptr` with a straightforward fun-ptr deleter. Reviewed By: iahs Differential Revision: D26246619 fbshipit-source-id: 3d0214ccb6c4730ca7b573065b4468a0dce85d40
-
Yedidya Feldblum authored
Summary: Introduce `folly::detail::thunk`, a carefully curated collection of generic general-purpose thunk templates: `make`, `ruin`, `ctor`, `dtor`. Initial uses in `StaticSingletonManager` and `to_erased_unique_ptr`. Reviewed By: vitaut Differential Revision: D26417824 fbshipit-source-id: 482f4154a957b3c3dbeede726ed870a8d10c2a32
-
Yedidya Feldblum authored
Summary: Define macro `FOLLY_CPLUSPLUS` on all platforms. Move the initial C++ language version check below the `#include` group. Reviewed By: Orvid Differential Revision: D26420758 fbshipit-source-id: 33d156ae944e7112b007afc49e8fb929dc677b85
-
Dan Melnic authored
Summary: Move REGISTER_TYPED_TEST_CASE_P to cpp from h Reviewed By: yfeldblum Differential Revision: D26440651 fbshipit-source-id: 7efd63b2f4af3de206cf2abdba33c849145c7834
-
- 13 Feb, 2021 2 commits
-
-
Dan Melnic authored
Summary: Avoid static init crash in testing::internal::TypedTestCasePState::VerifyRegisteredTestNames when compiling with clang 9.0 (works OK with clang-8.0) Reviewed By: yfeldblum Differential Revision: D26419675 fbshipit-source-id: c961ac0f73e3fc8d8852eb32c0b89634fb854c37
-
Ilya Maykov authored
Summary: See title. Reviewed By: yfeldblum Differential Revision: D26419855 fbshipit-source-id: 2857c80eb2500d8d3d5f815a1f795ddeac31165f
-
- 12 Feb, 2021 4 commits
-
-
Samuel Miller authored
Summary: This allows the test client to be used with session tickets enabled, if desired Reviewed By: yfeldblum Differential Revision: D25795104 fbshipit-source-id: 1adfb6c17c6da24db9c6367485a5cd0f8e534661
-
Kevin Vigor authored
Summary: Existing API allows user to specify a single preferred CPU for SQ_POLL workers, but it also allows specifying multiple workers. Add API to allow specifying a set of CPUs, not just one. The specified set of CPUs are used in round-robin fashion, so it is not strictly necessary that the number of CPUs and the number of workers be the same. #forceTDHashing Reviewed By: yfeldblum Differential Revision: D26380317 fbshipit-source-id: ecfd8722670ffc3e3dc246fae1bcb7f4d8e6f3e4
-
Dan Melnic authored
Summary: Lower max submit so the test will not fail with EINVAL when SQ size is > CQ size Reviewed By: kevin-vigor Differential Revision: D26419746 fbshipit-source-id: f9cbd4bef06b314f43ab667646d9e5ef61999246
-
Ilya Maykov authored
Summary: See title Reviewed By: knekritz Differential Revision: D26320388 fbshipit-source-id: 2796ae36cd8779f56474d21e89e80562f7bad22d
-
- 11 Feb, 2021 1 commit
-
-
Yedidya Feldblum authored
Summary: The `AsyncGenerator` test for `co_safe_point` immediately-invokes a temporary coroutine function to return a coroutine object, but the temporary coroutine function goes out of scope while the returned coroutine is live. Use `co_invoke` to fix it. Reviewed By: lxfind Differential Revision: D26408345 fbshipit-source-id: 4650ea57c01baffb1065560b661e3296cb0292cc
-