- 17 Jun, 2019 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] A semaphore type for testing scenarios which need a basic portable semaphore. Supports FIFO and LIFO wake policies. May be used when testing other, more sophisticated, semaphore types. Reviewed By: strager Differential Revision: D15843438 fbshipit-source-id: 9136e8e19ea79fce4191e69795d5fe848a482f03
-
- 15 Jun, 2019 4 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Fix a `DistributedMutex` build failure under MSVC, which does not have great support for whatever is happening here, which in this case is a case of variable templates with SFINAE. Not much information to go on, so this is a best guess: ``` folly/synchronization/DistributedMutex-inl.h(563): fatal error C1001: An internal error has occurred in the compiler. ``` Reviewed By: aary Differential Revision: D15837884 fbshipit-source-id: 8da993cc27373f86728963d2112812c15a4f34ea
-
Yedidya Feldblum authored
Summary: [Folly] Let `FutureSplitter` hold a `Executor::KeepAlive<>` rather than a raw `Executor*`. Reviewed By: andriigrynenko Differential Revision: D15835712 fbshipit-source-id: c0d5b4271212708657f550d5df51d4272e33fc44
-
Yedidya Feldblum authored
Summary: [Folly] Add `Executor::KeepAlive` copy-assignment operator. Before this change, the copy-assignment operator is implicitly defined as deleted because it is not explicitly defined and `Executor::KeepAlive` has any of a user-declared move constructor or a user-declared move-assignment operator. This is true even though it has converting assignment operators that look like copy-assignment, because the copy-assignment operator is defined as deleted and it is more specific than the converting assignment operators so it is the best candidate overload at overload resolution time. See: https://en.cppreference.com/w/cpp/language/copy_assignment. Reviewed By: andriigrynenko Differential Revision: D15836577 fbshipit-source-id: 4f0887875db2e0233d48d71f2f05d925300d3dc3
-
Yedidya Feldblum authored
Summary: [Folly] Explicitly use correct flags type in `Executor::makeKeepAlive` rather than relying on implicit conversion from `bool` after {D15683241}. Reviewed By: andriigrynenko Differential Revision: D15835078 fbshipit-source-id: 49d7895bc909996b646c19c6a2fa0690a58cbe13
-
- 14 Jun, 2019 4 commits
-
-
Ying Hu authored
Summary: add emplace for folly::sorted_vector_map Reviewed By: yfeldblum Differential Revision: D15789529 fbshipit-source-id: 2afccd4553cc53afd0e92729841120722f72b1ae
-
Nick Terrell authored
Summary: Use `folly::annotate_object_leaked()` in `folly::LeakySingleton` instead of its own custom suppression. Additionally, this removes the overhead of the `std::list<>` in opt-mode, but this is minor. Reviewed By: yfeldblum Differential Revision: D15755787 fbshipit-source-id: 053b8789c58941176977e6adbc4863d33d6ebed9
-
Nick Terrell authored
Summary: Add a function `folly::annotate_object_leaked(void const*)` that suppresses LSAN warnings for the passed pointer. It does so by keeping a static map of all the pointers passed to the function. Objects can later be unsuppressed with `annotate_object_collected(void const*)`. When ASAN is disabled the function is an inlinable no-op. This function is useful when you want to intentionally leak memory, and LSAN isn't smart enough to detect the pointer stored in memory. For example at the time of writing LSAN cannot follow the pointer in `folly::atomic_shared_ptr`. Reviewed By: yfeldblum Differential Revision: D15755788 fbshipit-source-id: d9be0cfb253f1b89d691892eb085c0b2349c4438
-
Yedidya Feldblum authored
Summary: [Folly] Fix `DistributedMutex` build failure under MSVC, which fails to understand conversion from `std::integral_constant<T, ...>` to `T` in variable template parameter-list contexts. Fixes #1164. Reviewed By: aary Differential Revision: D15819859 fbshipit-source-id: 1a2647e908fd9ad3362c4bea15d64db75a79f95d
-
- 13 Jun, 2019 10 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Lift the `accept4` check to an explicit preprocessor symbol set at configure time. Reviewed By: gkmhub Differential Revision: D15802038 fbshipit-source-id: e85a258bb6650af42ab149b0bff4854196c3157d
-
Joe Loser authored
Summary: - In defining `FOLLY_EXPORT`, we define it differently based on the GCC version. In the case of using GCC or Clang 5+, it will rely on `[[gnu::visibility("default")]]` which is a C++-specific attribute. - Since `CPortability.h` is intended to be made to be included for C projects, remove `[[gnu::visibility("default")]]` and always define `FOLLY_EXPORT` using `__attribute__` syntax which works in C. Pull Request resolved: https://github.com/facebook/folly/pull/1152 Reviewed By: yfeldblum Differential Revision: D15618549 Pulled By: Orvid fbshipit-source-id: fdc72d73f7b38b8a4196cc5677d814544968fb37
-
Nathan Bronson authored
Summary: This diff adds folly/memory/MemoryResource.h, which includes <experimental/memory_resource> or <memory_resource> if they are available. Reviewed By: yfeldblum Differential Revision: D15789182 fbshipit-source-id: ff8410b59354af7124a50ca6000c072372397cda
-
Joe Loser authored
Summary: - Simplify `_fs` user defined literal by removing the preprocessor branch. - Since Folly only supports C++14 now, `#if __cplusplus >= 201402L` will always evaluate to true. Pull Request resolved: https://github.com/facebook/folly/pull/1149 Reviewed By: ericniebler Differential Revision: D15638288 Pulled By: yfeldblum fbshipit-source-id: b690e51cbe8ba57baeb8704722e9f126f15e9d4a
-
Yedidya Feldblum authored
Summary: [Folly] Split `kIsSanitizeAddress` and `kIsLibrarySanitizeAddress`, letting them follow the corresponding preprocessor symbols. Reviewed By: simpkins Differential Revision: D15773943 fbshipit-source-id: 938ae9d4106a18c3115df5bdbf8560531da3ccbe
-
Michael Park authored
Summary: This patch names the thread inside `ObserverManager::NextQueue`, similar to the vector of threads in `ObserverManager::CurrentQueue`. Reviewed By: yfeldblum Differential Revision: D15746165 fbshipit-source-id: 02df5616dcc2af27f318088c051a49d14df9a4df
-
Aaryaman Sagar authored
Summary: Some optimizations and changes to make mutex migrations easier: - Add exception handling support, this allows using lock_combine pretty much anywhere a unique_lock would be used and makes transitioning between lock methods easier and more efficient as users aren't required to maintain their own unions anywhere (eg. with folly::Try) - Add support for big return values so people can return anything from the critical section. Without this, users would have to use code of the following form, which is prone to false sharing with metadata for the waiting thread ``` auto value = ReturnValue{}; mutex.lock_combine([&]() { value = critical_section(); }); ``` - Add some optimizations like inlining the combine codepath and an optimistic load to elide a branch. This gets us a ~8% throughput improvement from before. More importantly, This prevents compilers from messing up the generated code to dereference the waiter node whenever they feel like. - Defer time publishing for combinable threads until a preemption. This gets us to the same level of efficiency as std::atomic even on broadwell, takes us to 7x of the baseline (std::mutex) on the NUMA-less machines and almost perfectly parallel in the moderate concurrency levels. I suspect we can do better with NUMA-awareness, but that's for another diff Reviewed By: yfeldblum Differential Revision: D15522658 fbshipit-source-id: 420f4202503305d57b6bd59a9a4ecb67d4dd3c2e
-
Yedidya Feldblum authored
Summary: [Folly] Rename `to_underlying_type` to `to_underlying`, following the pattern of `to_unsigned` and `to_signed`. (Note: this ignores all push blocking failures!) Reviewed By: mzlee Differential Revision: D15776448 fbshipit-source-id: d1f87e917c22a1aa47fb5e37a3ecf7032cec0d48
-
Alexey Spiridonov authored
Summary: The anticipated (and desired) effect of this change is to make it so that `SKIP` in `SetUp` will actually always skip the test. Right now, test behavior depends on the setting `FOLLY_SKIP_AS_FAILURE` — when this is false, the test will get **executed** despite being "skipped". I believe it's unlikely that tests rely on the current behavior of doing `SKIP` from `SetUp` and running the test anyway. So, I expect this to be a relatively safe change. Reviewed By: simpkins Differential Revision: D15703771 fbshipit-source-id: d32e1d9c4cb8cb99c667882b81946154c6ca906b
-
Aaryaman Sagar authored
Summary: DeterministicSchedule does not work on mobile because __thread or thread_local support is not present. folly::ThreadLocal helps because it uses pthread_getspecific for mobile and platforms where support for this is not there This does mean that we can't add DSched tests for folly::ThreadLocal, but that does not have DSched tests anyway. When we add DSched tests for that, we can move to using a lock + map keyed by std::this_thread::get_id Reviewed By: yfeldblum Differential Revision: D15770455 fbshipit-source-id: 2a3cc6b3b1c116469cce6295a641d784e5bdfd50
-
- 12 Jun, 2019 4 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Always define `FOLLY_LIBRARY_SANITIZE_ADDRESS` to either 0 or 1. Reviewed By: simpkins Differential Revision: D10414836 fbshipit-source-id: d60ef8380c50971858ed282374f1b5973a27cdf4
-
Joe Loser authored
Summary: - Cut `#if __GNUC_PREREQ(5, 0)` preprocessor directive as folly does not support any GCC version lower than 5.1. - Change from `FOLLY_GNU_DISABLE_WARNING` to `FOLLY_GCC_DISABLE_WARNING` since Clang does not support `-Wbool-compare` option. Pull Request resolved: https://github.com/facebook/folly/pull/1151 Reviewed By: Orvid Differential Revision: D15618528 Pulled By: yfeldblum fbshipit-source-id: 039e0aad617ccb40392505a6f4585e93d52dc81c
-
Nick Terrell authored
Summary: Fix https://github.com/facebook/folly/issues/1111 by calling `assign()` directly. All `ExpectedStorage::assign()` implementations eventually call `doEmplaceAssign()` which uses SFINAE to assign, and if that fails emplace. Therefore, they only need `std::is_constructible`. Reviewed By: yfeldblum Differential Revision: D15756301 fbshipit-source-id: e7759128c13344ed6e3d58d6ea143fd68af8121b
-
Yedidya Feldblum authored
Summary: [Folly] Rename `FOLLY_ASAN_ENABLED` to `FOLLY_LIBRARY_SANITIZE_ADDRESS`. Reviewed By: simpkins Differential Revision: D10414837 fbshipit-source-id: b7ca2a36dd7f91ccab2f8051f78c75909f378d16
-
- 11 Jun, 2019 5 commits
-
-
Adam Simpkins authored
Summary: This is a hack for now to allow fbsource-based watchman getdeps builds to succeed. In the long run we need to update Watchman's CMakeLists.txt to depend on a proper EdenFS build, rather than copying Eden's thrift files into Watchman's source tree. Reviewed By: wez Differential Revision: D15753320 fbshipit-source-id: 2dea483c2053c4ea1cf64021c4bbc3239fce645d
-
Yedidya Feldblum authored
Summary: [Folly] Support various operations on empty `IPAddress` and `SocketAddress`, i.e. default-constructed instances, such as `operator==` and `hash`. V.s. throwing exceptions. Reviewed By: simpkins Differential Revision: D15750100 fbshipit-source-id: 89853635f6aab3c295f6fca4e66e6435b0839357
-
Shrikrishna Khare authored
Summary: The previous diffs in the stack add fbcode_builder manifests for FBOSS dependencies iproute2 and OpenNSL. The other FBOSS dependencies already have fbcode_builder support. Thus, add FBOSS manifest. Additionally, this patch also modifies fboss CMakeLists.txt to get FBOSS to build using fbcode_builder. Reviewed By: wez Differential Revision: D15626298 fbshipit-source-id: 31802ef695ae69b08f526bbeb299c59f3b9d44be
-
Shrikrishna Khare authored
Summary: D15683387 introduced manifest for libcurl and used cmake instead of autoconf (rationale: having cmake build curl would make it easy as we want curl to build on windows and macos). if libcurl finds ldap.h, then it builds with ldap enabled. On my devserver, ldap library is not installed, and thus libcurl builds without it, and links with FBOSS binaries fine. In sandbox, ldap seems to be installed, thus libcurl builds with ldap. However, linking fails for FBOSS binaries as those don't link against ldap - FBOSS does not depend on ldap. Thus, we need a way to configure libcurl with ldap disabled. [cmake.defines] CURL_DISABLE_LDAP=OFF, does not quite do it. Thus, am going with autoconf, with args --disable-ldap for now for Linux and cmake for non-Linux environments. Reviewed By: wez Differential Revision: D15730947 fbshipit-source-id: 2ce48976ee785401d550720cbdccb22f9d416675
-
Shrikrishna Khare authored
Summary: D15588809 introduced manifest and customer builder for iproute2. While the Iproute2Builder copies include/* from build to install directory, it does not copy lib/* which contains the libnetlink.a As a result, the build system looks up libnetlink.a on local machine (which it may not find). Fix it by explicitly coping lib/* as well. Reviewed By: wez Differential Revision: D15708835 fbshipit-source-id: 3f5906eb48ce982b6e887cca0d3c11314425beab
-
- 10 Jun, 2019 1 commit
-
-
Jingyi Yang authored
Summary: This diff allows zmq socket to run on folly::fibers Reviewed By: saifhhasan Differential Revision: D15113447 fbshipit-source-id: 8a0e1f91d719a9deda48837d4ff1065408280b72
-
- 09 Jun, 2019 2 commits
-
-
Eric Niebler authored
Summary: Build failures with gcc-7 suggest that gcc-7 is not property short-circuiting SFINAE conditions in the parameter list of function templates. Re-express as cascading tests to avoid the hard error. Reviewed By: yfeldblum Differential Revision: D15730238 fbshipit-source-id: 793e12630d609d4e135b4a55714be0cb0496f6f7
-
Luca Niccolini authored
Summary: Original commit changeset: 5e101fc38417 Reviewed By: snarkmaster Differential Revision: D15726457 fbshipit-source-id: 001ee9ebaee81ebc60996e5fb95c1870121b2dec
-
- 08 Jun, 2019 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Fixed constexpr append in `FixedString` tests after {D15618465}. ``` folly/test/FixedStringTest.cpp: In member function 'virtual void FixedStringAssignTest_ConstexprAppendLiteral_Test::TestBody()': folly/test/FixedStringTest.cpp:360:3: error: non-constant condition for static assertion static_assert(constexpr_append_literal_test() == "hello world!", ""); ^~~~~~~~~~~~~ In file included from folly/Range.h:25:0, from folly/FixedString.h:33, from folly/test/FixedStringTest.cpp:20: folly/test/FixedStringTest.cpp:360:47: in constexpr expansion of 'constexpr_append_literal_test()' folly/test/FixedStringTest.cpp:355:18: in constexpr expansion of '#'result_decl' not supported by dump_expr#<expression error>.folly::BasicFixedString<char, 20>::append((& s[7]))' folly/FixedString.h:1277:48: in constexpr expansion of 'folly::constexpr_strlen<char>(that)' folly/portability/Constexpr.h:68:21: error: 'strlen((& s[7]))' is not a constant expression return std::strlen(s); ~~~~~~~~~~~^~~ ``` Reviewed By: simpkins Differential Revision: D15643402 fbshipit-source-id: c7e26a0c37c956300364c566f211c866985d9dc2
-
- 07 Jun, 2019 3 commits
-
-
Nathan Bronson authored
Summary: It's common for people reading the F14 code to see the fallback implementation without noticing the #if !FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE at the top, which leads them to incorrect conclusions about the code. This diff flips the order in the file to reduce confusion. Reviewed By: shixiao Differential Revision: D15571969 fbshipit-source-id: 10d2aa29da3f1b8dd48af490a53f1f845f103fa8
-
Yedidya Feldblum authored
Summary: [Folly] Merge `folly/futures/helpers.h` into `folly/futures/Future.h` to avoid the cyclic include trap. Differential Revision: D15600550 fbshipit-source-id: a0d14c0092bb433f7af797201d9fafebab370502
-
Anton Likhtarov authored
Summary: pthread_getname_np() tries to dereference 0 when called with it, let's turn it into an error instead Reviewed By: yfeldblum Differential Revision: D15708351 fbshipit-source-id: aa2dd92e12e33174c8998daed056de50d4111774
-
- 06 Jun, 2019 5 commits
-
-
Zeyi (Rice) Fan authored
Summary: This diff adds an option "level" to standard log handler configuration so handlers can have individual logging level set. This allows us to have multiple handler that handles messages with different level settings. For example, > eden=DBG3:default:other; default=stream; other=stream:level=WARN; This configuration creates two log handlers "default" and "other". Both of the handlers will be receiving log messages level "DBG3" from "eden" log category. In this example, "other" handler will only be receiving log messages that is >= "WARN" while the "default" handler still receives all messages >= "DBG3". However, one catch of this diff is that, when the log category is set to a higher logging level and the log handler has a lower logging level. The log handler will NOT receive any log messages that is lower than the log category logging level. The test `LogLevelReverseTest` illustrate this situation. Reviewed By: simpkins Differential Revision: D15541101 fbshipit-source-id: 741aa97d2d5e93c40324bf6a3dd1d9e38f4dc6a5
-
Dan Melnic authored
Change SharedInfoObserverEntryBase::beforeFreeExtBuffer to SharedInfoObserverEntryBase::afterFreeExtBuffer Summary: Change SharedInfoObserverEntryBase::beforeFreeExtBuffer to SharedInfoObserverEntryBase::afterFreeExtBuffer Reviewed By: yfeldblum Differential Revision: D15687084 fbshipit-source-id: 8f77a123f1bdc0e0ee7391dee7da47d9b9addc6d
-
Shrikrishna Khare authored
Summary: This is towards getting open source FBOSS to build using fbcode_builder. libnl is one of the dependencies for FBOSS. This patch adds a manifest file to build libnl. Reviewed By: wez Differential Revision: D15686853 fbshipit-source-id: f7549df6dc1005630193b024be6e1ea330cc6646
-
Shrikrishna Khare authored
Summary: This is towards getting open source FBOSS to build using fbcode_builder. libcurl is one of the dependencies for FBOSS. This patch adds a manifest file to build libcurl. Reviewed By: wez Differential Revision: D15683387 fbshipit-source-id: 8df5c413e7dff06d1a19e0ce3b1706bff2f1ab54
-
Shrikrishna Khare authored
Summary: This is towards getting open source FBOSS to build using fbcode_builder. libusb is one of the dependencies for FBOSS. This patch adds a manifest file to build libusb. FBOSS does not need libudev, so we avoid unncessary dependency by passing right argument to ./configure. Reviewed By: wez Differential Revision: D15683386 fbshipit-source-id: 1d35caecf4012ddc0df24a7305019d522b4763fa
-