- 28 Nov, 2019 1 commit
-
-
Taylor Hopper authored
Summary: The `accumulate` algorithm will behave similarly to `std::accumulate`, but instead returns a `Task` of the accumulated result from the values in the `AsyncGenerator` Reviewed By: kirkshoop Differential Revision: D18714284 fbshipit-source-id: 66625cd1347d767467d98a421b78b6f45d70260c
-
- 27 Nov, 2019 11 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Check prev thread-id in `EventBase::loopBody` to enforce that it is not called concurrently. Reviewed By: andriigrynenko Differential Revision: D18722163 fbshipit-source-id: 01e18758e4d517011697e025519c84e29ca96636
-
Taylor Hopper authored
Summary: The `concat` algorithm will concatenate a series of streams known at compile time into a single stream of the same type. Reviewed By: kirkshoop Differential Revision: D18695001 fbshipit-source-id: 2da7f53cbc835333ffd9551ceae1aa5db085936d
-
Jorge Lopez Silva authored
Summary: This hadn't been updated since we moved to openssl 1.1 Reviewed By: knekritz Differential Revision: D18668447 fbshipit-source-id: 26d58ef759fccf7e97c4d127b747b093077f6e59
-
Yedidya Feldblum authored
Summary: [Folly] Use `relaxed` order for `EventBase::loopThread_` consistently. There is only one location which uses a different memory order. Atomic operations on this location do not guard any other locations, so non-`relaxed` memory orders are not required. Reviewed By: andriigrynenko Differential Revision: D18722614 fbshipit-source-id: b73b61e4845c34c58e9f4adbeb368c815b375d38
-
Uladzislau Paulovich authored
Summary: `folly::Function` has this explicit bool conversion operator and it makes sense to also have it for `SharedProxy`. Reviewed By: yfeldblum, ericniebler Differential Revision: D18504667 fbshipit-source-id: 32fede326c7a3eebd340dea9d118714a0cdfa5c0
-
Lee Howes authored
Summary: collectAny had this overload, it was missed when collectAnySemiFuture was added. Reviewed By: mpark Differential Revision: D18689251 fbshipit-source-id: 1fccd6eca9d4afde46a173842641f14aff78aada
-
Andrii Grynenko authored
Summary: Make sure that fiber stack overflow is immediatelly discoverable from the crash stack trace, not just from the error log. Reviewed By: spalamarchuk Differential Revision: D18702739 fbshipit-source-id: c0a05081e67b12c94b20a929b2d10396bc1b6949
-
Yedidya Feldblum authored
Summary: [Folly] Make `Function` shared proxy empty when constructed with an empty `Function`, just like it would be when constructed with `nullptr`. Reviewed By: ericniebler, vitaut Differential Revision: D18518858 fbshipit-source-id: fdad5b4cd30a1fda5465dae80054c5c74837faa9
-
Yedidya Feldblum authored
Summary: [Folly] Let ElfFile open functions return their error messages v.s. taking pointers to where to place them. Overall, making these functions a bit more C++. Reviewed By: luciang Differential Revision: D18668222 fbshipit-source-id: 395c20c5d0862c2b1dcc7f6f9db56b7958c5fc90
-
Anton Frolov authored
Summary: This diff fixes `CMakeLists.txt` to enable building `openr` tests using CMake: 1. It adds `add_openr_test` CMake function that adds executable target, registers it as test, links it with bunch of libraries like GTest and GMock, etc... 2. There is no `openr/tests/OpenrModuleTestBase.cpp` anywhere in the source tree, so this commit replaces it with `openr/common/Flags.cpp`. Reviewed By: jstrizich Differential Revision: D18584028 fbshipit-source-id: 07d854ef98d0d2509889a08ad042a371101a2825
-
Ahmed Soliman authored
Summary: Moving some `iobuf` helpers from the `thrift::py3` namespace into `folly` since this now lives in folly. Also fixing CMake to build iobuf in folly not in thrift. Reviewed By: vitaut Differential Revision: D16221272 fbshipit-source-id: a7bdde1b60cd6d7de06bf2040506a87c3153c37f
-
- 22 Nov, 2019 6 commits
-
-
Adam Simpkins authored
Summary: Remove the Facebook-specific dependencies from the Eden manifest: these dependencies are now available directly in the Eden repository. Reviewed By: chadaustin Differential Revision: D18588009 fbshipit-source-id: 590c74e38e4e05939e6955839af3ebb959f9251b
-
Adam Simpkins authored
Summary: Remove the standalone fb-mercurial-rust target that was an internal-only dependency for the Eden build. This build step is now done entirely in the Eden build. Reviewed By: fanzeyi Differential Revision: D18623943 fbshipit-source-id: c62a1155ddd1c0a6b2270c472176ba25194c6145
-
Robin Battey authored
Summary: Re-implementation of fiber gdb integration. All previous functionality still works as well. Commands: * `fiber`: switch to fiber by address, alias, or assigned short id * `fiber apply`: run arbitrary gdb commands for each specified fiber (or "all") * `fiber deactivate`: switch back to normal thread behavior * `fiber name`: assign or clear an alias to a particular fiber * `info fibers`: print out each fiber manager and fiber, with ids and current frame info Parameters: * `fiber info-frame-skip-words`: the "uninteresting" function matches to skip frames of when showing fiber info * `fiber manager-print-limit`: limit of the number of fibers displayed when printing a fiber manager Fibers are assigned ids of the form "<MANAGER_ID>.<FIBER_ID>". When specifying fibers for `info fibers` or `fiber apply`, you can specify any number of space-separated fiber ids, and additionally you can specify a manager id by itself to refer to all fibers in that manager. When printing info with `info fibers`, every stopped fiber will be in `folly::fibers::FiberImpl::deactivate()`, which isn't particularly useful. To give more-useful information, it will skip past all frames whose function names include the strings "folly::fibers" or "wait" and print the first non-matching frame's information instead. The `fiber info-frame-skip-words` parameter defines the strings to match on, specified as a space-separated list of words. Due to gdb limitations, the selecting a fiber "masks" the currently selected thread, and to see the current thread again you will need to run `fiber deactivate`, same as before. Reviewed By: andriigrynenko Differential Revision: D18342802 fbshipit-source-id: 5b2204bb09eca4c8f977c6c17b0348e39465dff6
-
Koray Polat authored
Summary: - Added sai to getdeps - added SAI to FBOSS as a dependency - Included path of SAI headers to FBOSS's cmake file. Reviewed By: shri-khare Differential Revision: D18629127 fbshipit-source-id: 119a6b7f2b64bd84414d9e16a903bc8df48a35e7
-
Lee Howes authored
Summary: The mutable global executor is problematic: it defaults to Inline, and it is constructed off of an error-prone weak_ptr and it returns a shared_ptr. A KeepAlive-based global immutable executor is a cleaner default. This change adds immutable global executors, and moves the default executors into separate singletons for cleaner interaction between the mutable executor and the underlying default immutable ones, including the default inline global cpu executor. Reviewed By: andriigrynenko Differential Revision: D18513433 fbshipit-source-id: 0ad825c34cc7ba935f57ff81adb8cff3bf001a45
-
Dennis Zhou authored
Summary: With THP set to madvise, page faults on these pages will block until a huge page is found to service it. However, if memory becomes fragmented before these pages are touched, then we end up blocking for kcompactd to make a page available. As this increase pressure, oomd comes in and kills us :(. So, preemptively touch these pages to get them backed as early as possible to prevent stalling due to no available huge pages. Reviewed By: hnaz, interwq Differential Revision: D18579722 fbshipit-source-id: 5f54676a128207026cb16b9cdc03a055cbb1f9b9
-
- 21 Nov, 2019 4 commits
-
-
Banit Agrawal authored
Summary: This diff disables the purging of huge pages and hence they will never be freed and will be counted towards the RSS of the process. This was done to ensure that we don't block on madvise call to get the huge pages and increase memory pressure on the system. Reviewed By: gdankel Differential Revision: D18607196 fbshipit-source-id: 79e483a715290fdfbdd1963433ec3918561a0e0e
-
Aaron Dierking authored
Summary: Clang 7 seems to have trouble with `FOLLY_CREATE_MEMBER_INVOKER()` on Windows targets if the invoker's name is the same as the invocable name. It's spewing `-Wmicrosoft-explicit-constructor-call` warnings and the `static_assert`s in LockTraits.h are failing. As a workaround, we can rename the LockTraits.h invokers to use an `_invoker` suffix. See https://gcc.godbolt.org/z/j4qRd9 for a demonstration of the issue. Reviewed By: vitaut Differential Revision: D18626335 fbshipit-source-id: c9147daaa10b02b0692c32963f9ede8cc645e329
-
Adam Simpkins authored
Summary: Include tools/lfs in the shipit path map for now, since it is needed to download vendored Rust crates on internal builds. Also correctly indicate that the fb-mercurial* dependencies also apply only to internal builds. Reviewed By: chadaustin Differential Revision: D18621421 fbshipit-source-id: 74f00bf318ff9aefdca8696a61a8f33587749e66
-
Adam Simpkins authored
Summary: Automatically detect the `--facebook-internal` flag based on the current repository project name. Reviewed By: wez Differential Revision: D18621358 fbshipit-source-id: f2b3018169b151811eec455863a8bfc17667d4d8
-
- 20 Nov, 2019 5 commits
-
-
Sasha Elaine Fox authored
Summary: Dovetailing off of https://github.com/facebook/folly/issues/1262 ; Folly's dependency on `fmt` isn't explicitly mentioned nor are from-source install instructions provided. This PR adds a short section to the README describing how to build and install fmt from source. Pull Request resolved: https://github.com/facebook/folly/pull/1263 Reviewed By: vitaut Differential Revision: D18622693 Pulled By: yfeldblum fbshipit-source-id: e43ab8c5524df9decc79cdd0cb2aea3d88826617
-
generatedunixname89002005287564 authored
Reviewed By: yfeldblum Differential Revision: D18614792 fbshipit-source-id: 9b77ae8aba9153c9051dd5935cda807dfad4e6e2
-
Yedidya Feldblum authored
Summary: [Folly] `FOLLY_CREATE_STATIC_MEMBER_INVOKER`, for creating invoker types which can invoke class static members. Reviewed By: vitaut Differential Revision: D18035183 fbshipit-source-id: 2bcab988f684042b26843d5fe0a13ad7c549e43a
-
Giuseppe Ottaviano authored
Summary: Since D18140137 `reset()` doesn't perform any data reads, so we can simplify the implementation of the `jump*` functions to just reset the reader in case of a backward jump. The only tricky case we need to handle is when `jumpTo` is called from the middle of a run of identical values. Delegating to `skip*` the additional benefit of inheriting the optimizations for small forward skips. Differential Revision: D18496743 fbshipit-source-id: 73dc8b21534fba90f1ac2a924a7cebc56ffaba94
-
Yedidya Feldblum authored
Summary: [Folly] `to_narrow`, for explicitly performing a possibly-narrowing integral conversion without specifying the destination type. Does not permit changing signs. Reviewed By: luciang Differential Revision: D18498269 fbshipit-source-id: be597daf981376758effa0b3721cad67a49c9ef1
-
- 19 Nov, 2019 6 commits
-
-
Constantin Dolghier authored
Summary: 1) SharedPromise is semantically a regular Promise one can get multiple Futures off. One would expect that all methods which are const in Promise to also be const in SharedPromise - but they are not because their implementations needs using a mutex. 2) Semantically, `SharedPromise::getFuture()` and `SharedPromise::getSemiFuture()` do not change the observable state of the object. 3) As real-life consequence, these non-const `SharedPromise` methods become viral in downstream code which then has to hack around it in downstream `const` methods by marking the SharedPromise instance mutable. That solution leads to the program being less const-correct than it should be, as now the type system allows `const` methods to reassign or `setValue` the SharedPromise. This diff changes `hasResult`, `isFulfilled`, `size()`, `getFuture()` and `getSemiFuture()` to be `const`. In order to achieve that, the private fields `mutex_` and `size_` had to be marked `mutable`. (Note: this ignores all push blocking failures!) Reviewed By: yfeldblum Differential Revision: D18565877 fbshipit-source-id: ff63a48c02235f72c5b0191423ae68f7b7c42fb3
-
Adam Simpkins authored
Summary: On Windows, compile a small C executable to prepend to the zip file, to allow the resulting executable files to be run directly on Windows, without needing to explicitly invoke the Python interpreter to run the output file. Reviewed By: wez Differential Revision: D17733616 fbshipit-source-id: 989a93851412d0bbe1e7857aa9111db082f67a4c
-
generatedunixname89002005287564 authored
Reviewed By: yfeldblum Differential Revision: D18449687 fbshipit-source-id: 6d630cef35132abb157e80d02ad2b6dee7268fce
-
Jason Rahman authored
Summary: Expose the call to folly::Optional::value_or() in the Cython bindings Reviewed By: nanshu Differential Revision: D18526111 fbshipit-source-id: f2694ca589bf73653bc86d5c98b52e15406bed77
-
Jason Rahman authored
Summary: Add basic wrapper to support wrapping C++ APIs that contain folly::Function in their interfaces. Does not support calling operator() from within Cython, but only pass through of folly::Function<> to such APIs. Reviewed By: nanshu Differential Revision: D18526112 fbshipit-source-id: d219d480e59464099a109e5ef30d015151588b1f
-
Jason Rahman authored
Summary: Add new cython wrapper class to expose folly::Expected to other cython_libraries Reviewed By: jkedgar Differential Revision: D18523642 fbshipit-source-id: 0dfb4820b2613361b7c1af05b89b5231a1bfecbc
-
- 18 Nov, 2019 2 commits
-
-
Giuseppe Ottaviano authored
Summary: EliasFanoCoding supports sequences with duplicate values, but there is no test coverage and the behavior of some corner cases (`skipTo` and `jumpTo` from the middle of a run) is not documented. This diff adds coverage and documentation. Reviewed By: yfeldblum Differential Revision: D18496744 fbshipit-source-id: 00e112a902a8b11ac9601520b858172a1d2c0f57
-
Victor Zverovich authored
Summary: Now that fmt is available in Folly builds (D14813810), use it to reduce binary code size in Folly Logger. This is done by moving most of the formatting logic behind the type-erased `vformat` API. Previously it was instantiated for all combinations of formatting argument types used in calls to `FB_LOGF` and `XLOGF` in a program. The effect of this change can be illustrated by looking at symbol sizes as given by `nm -S -td` for the following test function: ``` void test_log() { FB_LOGF(logger, WARN, "num events: {:06d}, duration: {:6.3f}", 1234, 5.6789); } ``` compiled in `opt` mode. `nm` before: ``` 0000000004236736 0000000000000231 T test_log() 0000000004236992 0000000000001002 W std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > folly::LogStreamProcessor::formatLogString<int, double>(folly::Range<char const*>, int const&, double const&) ``` `nm` after: ``` 0000000004237536 0000000000000231 T test_log() 0000000004237792 0000000000000251 W std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > folly::LogStreamProcessor::formatLogString<int, double>(folly::Range<char const*>, int const&, double const&) 0000000004238048 0000000000000740 W folly::LogStreamProcessor::vformatLogString[abi:cxx11](folly::Range<char const*>, fmt::v5::format_args, bool&) ``` Before we had one 1002 byte instantiation of `formatLogString<int, double>`. With this change it was reduced 4x to 251 bytes and non-template function `vformatLogString` was added which is shared among all logging calls. The size of `test_log` remained unchanged. There are even bigger savings from Folly Formatter instantiations which are no longer needed, e.g. ``` 0000000004238032 0000000000001363 W _ZNK5folly13BaseFormatterINS_9FormatterILb0EJRKiRKdEEELb0EJS3_S5_EEclIZNKS7_8appendToINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENSt9enable_ifIXsr12IsSomeStringIT_EE5valueEvE4typeERSH_EUlNS_5RangeIPKcEEE_EEvSK_ ``` So in total this change results in ~5x per-call/instantiation binary size. It is possible to reduce binary size even further but it is not done in the current diff to keep it manageable. In addition to binary size improvements, switching to fmt will potentially * allow catching errors in format strings at compile time, * simplify future migration to C++20 [`std::format`](http://eel.is/c++draft/format). Reviewed By: simpkins Differential Revision: D15485589 fbshipit-source-id: 06db4436839f11c2c3dbed7b36658e2193343411
-
- 17 Nov, 2019 1 commit
-
-
Wez Furlong authored
Summary: When we detect that we are building out of the fbsource monorepo internal to FB, pre-set some environment variables to help projects detect our internally pinned versions of node and yarn. Previously, the detection logic was deciding that the `yarn` shell script was the executable to invoke, but since that is a bash script it would fail to spawn. Reviewed By: simpkins Differential Revision: D18523871 fbshipit-source-id: b932d2b0ccd7b79d6f9cd74d363bc426c288e38f
-
- 16 Nov, 2019 2 commits
-
-
Maged Michael authored
Summary: Original commit changeset: 6021479ab36c Reviewed By: d4l3k Differential Revision: D18535981 fbshipit-source-id: 4f9e5da29ed6d9bae04f29bcf273b41d39cc5754
-
Maged Michael authored
Summary: Original commit changeset: a1af88dfa1b6 Reviewed By: d4l3k Differential Revision: D18535282 fbshipit-source-id: 16da3084a519f978bf33f197ab7f937b61bb9d07
-
- 15 Nov, 2019 2 commits
-
-
generatedunixname89002005287564 authored
Reviewed By: yfeldblum Differential Revision: D18528940 fbshipit-source-id: 288abb510535540698416ac046c1057e110e4478
-
Yedidya Feldblum authored
Summary: [Folly] Erase the invokers. A catchy title, but forcibly inline the invoker call operators. Reviewed By: vitaut Differential Revision: D18035184 fbshipit-source-id: 5cf57d785523904a5260f7ed24c9ed34148370eb
-