- 25 Jun, 2019 1 commit
-
-
Kirk Shoop authored
Summary: interval_repeat is an algorithms for single senders. it repeats the predecessor single at the start time and again on an interval relative to that start time. the last parameter is an optional function that allows the time used for the next schedule to be modified. Reviewed By: ericniebler Differential Revision: D15945618 fbshipit-source-id: d03cf079d870ceb65e9502c9ff0edcb87b6fd25e
-
- 22 Jun, 2019 1 commit
-
-
Christos Stratopoulos authored
Summary: Fixes https://github.com/facebook/folly/issues/737 My use of `std::add_pointer_t` deviates in style from the alias decls in other `SignatureOf_` specializations because it is not possible with that syntax to declare a pointer to `noexcept` function. Pull Request resolved: https://github.com/facebook/folly/pull/1173 Reviewed By: yfeldblum Differential Revision: D15906742 Pulled By: Orvid fbshipit-source-id: bb2af75d24d620f80b26ca4daa579e244be0e6a8
-
- 21 Jun, 2019 5 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Avoid unnecessary ping-pong in portable test semaphore wakeup when `wait()` is called without callback arguments. Reviewed By: nbronson Differential Revision: D15903121 fbshipit-source-id: c40018bbd0c49f5114a340a9b97c8cc9f8f70a7c
-
Yedidya Feldblum authored
Summary: [Folly] Fix test semaphore crash when post races with dtor after wait. Reviewed By: nbronson Differential Revision: D15896692 fbshipit-source-id: a7caf9795b76c2a6eaa929b907e160107570160d
-
Aaryaman Sagar authored
Summary: The integration with folly::Synchronized has not landed, remove the comment that mentions it (Note: this ignores all push blocking failures!) Reviewed By: yfeldblum Differential Revision: D15891316 fbshipit-source-id: 890ddb85e36605ddec418e782d1f168ddd0cf66e
-
Andrii Grynenko authored
Reviewed By: yfeldblum Differential Revision: D15929165 fbshipit-source-id: 476dd6a69d232642437ac65f0519db5acc3a0608
-
Christos Stratopoulos authored
Summary: Introduces a `FOLLY_NTTP_AUTO` macro to test if NTTP is available. As per [cppreference](https://en.cppreference.com/w/User:D41D8CD98F/feature_testing_macros), the macro `__cpp_nontype_template_parameter_auto` is the correct feature test macro to use for the NTTP used to define poly member list. The `__cpp_template_auto` version is checked too, but it was [deprecated](https://fossies.org/diffs/gcc/8.2.0_vs_8.3.0/gcc/c-family/ChangeLog-diff.html) in gcc 8.3 and not supported at all in MSVC. Pull Request resolved: https://github.com/facebook/folly/pull/1174 Reviewed By: yfeldblum Differential Revision: D15906768 Pulled By: Orvid fbshipit-source-id: 831213ec1214a234246bb6b01be89574a0cace25
-
- 20 Jun, 2019 7 commits
-
-
Nathan Bronson authored
Summary: This diff restricts use of memory_resource to C++17 or later, to avoid problems with compilation on some MSVC platforms. Reviewed By: kevinhu88 Differential Revision: D15923470 fbshipit-source-id: 91b2446c096fbcb71c8bf5a0f1967bff4cbd1ce8
-
Yedidya Feldblum authored
Summary: [Folly] Use the portable test semaphore in `DeterministicSchedule`, v.s. `sem_t` which is not portable everywhere. The portable test semaphore is implemented purely in terms of `std::mutex` and `std::condition_variable`, and is therefore portable. Reviewed By: nbronson Differential Revision: D15909982 fbshipit-source-id: 63b3e5d16864ffee9fad20bd2ad46730fba220dd
-
Yedidya Feldblum authored
Summary: [Folly] A test semaphore with no wake policy, and a rename of the existing test semaphore template for clarity that it has a wake policy. Reviewed By: nbronson Differential Revision: D15909983 fbshipit-source-id: 291566daab4838030e25fce862d42e15f2a4a8aa
-
Matt Glazar authored
Summary: In Facebook's Buck-based build system, folly/system/MemoryMapping.cpp depends on folly/experimental/io/HugePages.cpp. This works well on Linux, and in theory works well on macOS because HugePages.cpp has no OS-specific code at build time. However, because HugePages.cpp has a transitive dependency on the range-v3 library, and because range-v3 isn't available in Facebook's build system for macOS yet, building HugePages.cpp on macOS fails. On macOS, avoid MemoryMapping.cpp's dependency on HugePages.cpp (and thus the transitive dependency on range-v3). Use a manual annotation to prevent the Facebook's autodeps tool from forcing the dependency on macOS in Buck. (It looks like autodeps does not interpret `#ifdef __linux__`.) On Linux (servers), this diff should not change behavior. This diff does not fix the issue in folly's CMake build system. Reviewed By: yfeldblum Differential Revision: D15775751 fbshipit-source-id: 612790caab673c0fc52eb3054aa5789f767c7353
-
Zeyi (Rice) Fan authored
Summary: This diff adds a check in `AsyncLogWriter`'s destructor that checks if its subclass called `cleanup()` to drain all the pending log messages in the queue during destructing. Reviewed By: yfeldblum Differential Revision: D15383734 fbshipit-source-id: deca9bdc84d5f514f2d47a250d31a68126d20aad
-
Zeyi (Rice) Fan authored
Summary: This diff moves `onIoError` into `AsyncFileWriter` as it is specifically related to writing to file. Reviewed By: yfeldblum Differential Revision: D15324855 fbshipit-source-id: 3929a53aee7febd9185b71dfdb894990dee73413
-
Zeyi (Rice) Fan authored
Summary: This diff splits `AsyncFileWriter` into two parts: `AsyncLogWriter` and `AsyncFileWriter`, so we could re-use the asynchronous IO operating logic with other types of log writer. See the following diffs for example use case. `AsyncLogWriter` is a virtual class that provides the asynchronous logic and manages a queue of incoming log messages. The users can write subclasses with this class to provided their own IO implementation by overriding the virtual method `performIO`. `AsyncFileWriter` is one implementation of the `AsyncLogWriter` that writes incoming log messages to a file. Most of this diff is simply moving things around. Substantial changes are placed in next diff. Reviewed By: chadaustin Differential Revision: D15228054 fbshipit-source-id: 86c3405755099c59aa2df8a310250fded648e413
-
- 19 Jun, 2019 8 commits
-
-
Dylan Yudaken authored
Summary: It might not be obvious that the parent in Subprocess::Options refers to the parent thread (see man PRCTL(2)). Reviewed By: yfeldblum Differential Revision: D15873239 fbshipit-source-id: 2a1cc840281d25030708e4d10e633c7d8a9158ed
-
Orvid King authored
Summary: An atomic hash array with zero elements isn't useful in any way, not even as an empty set (due to it not being comparable), and there are multiple places that simply crash if you try to use, so just prevent it from being constructed in the first place. Reviewed By: yfeldblum Differential Revision: D15789540 fbshipit-source-id: a811f70fb0e9e21a83dc9aea79ec017ae2d7e0a5
-
Scott Pruett authored
Summary: The documentation on length() is somewhat ambiguous when dealing with chains of IOBufs -- it is only clear after reading implementations that "data" refers to "the data in this single IOBuf, potentially only part of a chain". Reviewed By: yfeldblum Differential Revision: D15830189 fbshipit-source-id: d3319abd2d53a76665442d1b93b78a7d1a77dcc0
-
Andrii Grynenko authored
Summary: It's not safe to access the core after setCallback_ was called, while SemiFuture::operator= may check core_.executor_ Reviewed By: yfeldblum Differential Revision: D15871436 fbshipit-source-id: 1fe0a6b3fe1638cd8f5bab49572203f7b252c0dd
-
Prabhakaran Ganesan authored
Summary: TOS reflected is implemented in the AsyncServerSocket layer. The way it works is by extracting the TOS value from cached SYN packet and applying a setsockopt() on the accepted socket. But if the TOS value in the cached SYN packet is ZERO, this results in TOS=0 for the accepted socket, resulting in problems. Made changes to limit TOS reflection only if SYN carries non-zero TOS. Reviewed By: yfeldblum Differential Revision: D15633518 fbshipit-source-id: 856ba2059145e37fdab580b094349632677a40ba
-
Aaryaman Sagar authored
Summary: std::max() is not constexpr for the platform we build with on android for some reason Reviewed By: yfeldblum Differential Revision: D15848911 fbshipit-source-id: aa8b62514b0b1b23f9a179736c2e79885ddf8689
-
Orvid King authored
Summary: To prevent ultra large allocations from causing out of bounds read & writes. Reviewed By: yfeldblum Differential Revision: D15610028 fbshipit-source-id: 5adaec121c1fc8a0f0d3d0e56b85fabb2ec89d4c
-
Nathan Bronson authored
Summary: Adds folly::pmr::* aliases for all of the F14 map and set types. The only missing piece for full pmr support was to tolerate a deleted operator= for allocators that are never actually assigned (based on the propagate_... properties). Reviewed By: yfeldblum Differential Revision: D15572220 fbshipit-source-id: fd9687a73bf67e5e9c7962cc788fae658ccf7d36
-
- 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 9 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
-