- 19 Mar, 2021 2 commits
-
-
Yedidya Feldblum authored
Summary: Rather than conditionally depending on libevent in a way which is causing downstream conflicts. Reviewed By: Orvid Differential Revision: D27121200 fbshipit-source-id: 4c4816e7cb2061718f81cd8a75ce4999b5b32042
-
Yedidya Feldblum authored
Reviewed By: vitaut Differential Revision: D27036041 fbshipit-source-id: 038b35b9690f17b59425c13c57176ac7dd017ea5
-
- 18 Mar, 2021 3 commits
-
-
Tristan Rice authored
Summary: Original commit changeset: ec402ad2badb reverting D27044720 (https://github.com/facebook/folly/commit/bda140dc1f4be1846a19e708b7c2a0aa6215c730) to S225748 This check was added in D22272411 (https://github.com/facebook/folly/commit/0ff36eaf684ee7c1eeac0e4592e47c92f2440323) as a fix for S204433. This is very likely the cause for S225748 since the behavior is very similar to the original sev Reviewed By: clrfb Differential Revision: D27166845 fbshipit-source-id: c0a3f44690cd7c0df5d2a67f433419b961922dec
-
Andrew Smith authored
Summary: This is an analogous change to D6665918 (https://github.com/facebook/folly/commit/4591832b4885f166236acee689dd2b11e3b3135b), which should reduce RSS variance due to extra allocated queue segments. Reviewed By: yfeldblum Differential Revision: D26770721 fbshipit-source-id: 7e83aaae1d5030c5ed50b34fae06236f0ead8ac1
-
Andrii Grynenko authored
Summary: Patch code to address build failures discovered with GCC. Reviewed By: ericniebler Differential Revision: D26682213 fbshipit-source-id: a45751e00ddbce01623e266bf3d6c9a72df40d26
-
- 17 Mar, 2021 3 commits
-
-
Yedidya Feldblum authored
Summary: For reasons unknown, some gcc versions disliked the previous code with the constexpr pointer variable, even though most supported compilers and versions accepted it. Reviewed By: aary, luciang Differential Revision: D27083528 fbshipit-source-id: b225a3f211a9b51b248cc079cf11e4e25ae30460
-
Aaryaman Sagar authored
Summary: As title. CLI applications that don't use gflags might not care about process-wide gflags, so add an option to kill it. Reviewed By: yfeldblum Differential Revision: D27066900 fbshipit-source-id: d412391879cd5ac89eba5903fd033775cf0ca49a
-
Lee Howes authored
Summary: By returning a generic KeepAlive<> the global IO executor was losing the IOExecutor interface. This fixes it by returning the right type. Reviewed By: yfeldblum Differential Revision: D27061083 fbshipit-source-id: d57f67982c3467a6b814b17e851e4513ffd33502
-
- 16 Mar, 2021 5 commits
-
-
Yedidya Feldblum authored
Summary: Add `reset_once`, a mechanism to reset a `once_flag`. Reviewed By: Mizuchi Differential Revision: D27071246 fbshipit-source-id: 4824782fb0ce6380b72e3e657e6f5073029eaf14
-
Yedidya Feldblum authored
Summary: A helper for use with check functions using `FOLLY_KEEP`. Reviewed By: luciang Differential Revision: D27072070 fbshipit-source-id: 9c106ca1e0854b0f16453e8ad73d7001c3b7fff6
-
Yedidya Feldblum authored
Reviewed By: luciang Differential Revision: D27071414 fbshipit-source-id: 8bbe12e8f8264f2040c030e0353e1e4d59efae55
-
Jason Rahman authored
Summary: When folly::AsyncSSLSocket is used in unencrypted mode, zero copy is possible due to OpenSSL being bypassed, but the setZeroCopy() override in AsyncSSLSocket prevents zero copy from being used. Remove the override (no callers currently check the return value anyway). Reviewed By: yfeldblum, yqz, jalatif Differential Revision: D27044720 fbshipit-source-id: ec402ad2badb84150ecd1b7639770a49e16e9183
-
Oleg Osovitskiy authored
Summary: Add `CoInvokeWithoutArgs` helper, coroutine-aware version of `InvokeWithoutArgs` Reviewed By: yfeldblum Differential Revision: D27060013 fbshipit-source-id: 8024a5818fbe7759d3f9827d260c4e7370444bb0
-
- 15 Mar, 2021 3 commits
-
-
Yedidya Feldblum authored
Summary: Encourage new uses to use the overload which does not take an explicit list of exception types. Reviewed By: aary Differential Revision: D27041702 fbshipit-source-id: aa808bb432c2aea6e2c1cb10d76f2492875bae93
-
Dan Melnic authored
Summary: Fix -Werror,-Wshadow-uncaptured-local errors Reviewed By: yfeldblum, iahs Differential Revision: D27052090 fbshipit-source-id: 843bf9374ff16bfe422ef78e889f1c1286335c1a
-
Yedidya Feldblum authored
Summary: Principally, this change shrink the code generated by `FOLLY_SAFE_CHECK` by: * Moving the literal arguments which would be passed to the backing functions into a constexpr data structure and passing only a pointer to that data structure. * Passing all the arguments through via C variadic arguments rather than inlining the sequence of calls to handle them into the caller. Reviewed By: swolchok, luciang Differential Revision: D26996101 fbshipit-source-id: 61c39c08758a9de28ba0cfd342b174185e80ad9f
-
- 14 Mar, 2021 1 commit
-
-
Yedidya Feldblum authored
Summary: In particular, let `make` and `ctor` take variadic arguments since there is no cost. Reviewed By: iahs Differential Revision: D27024839 fbshipit-source-id: 805c65fdc79f60af1256a4c36be94bb22c163bdd
-
- 13 Mar, 2021 3 commits
-
-
Yedidya Feldblum authored
Summary: So that downstream locations do not have to write their own noop functions. Reviewed By: iahs Differential Revision: D27022664 fbshipit-source-id: e8f69c7babf853a71dedd24ded59c5017cf18ad6
-
Yedidya Feldblum authored
Summary: The interface: erased_unique_ptr to_erased_unique_ptr make_erased_unique copy_to_erased_unique_ptr empty_erased_unique_ptr Reviewed By: iahs Differential Revision: D26980776 fbshipit-source-id: c520993a2191e7f74c5056a4854e2b85731a09a0
-
Yedidya Feldblum authored
Summary: `snprintf` may not be async-signal-safe, but Elf code is intended for use in signal handlers. Reviewed By: luciang Differential Revision: D27000080 fbshipit-source-id: 818f48787b5712b7334eca782e18c71c17d03361
-
- 12 Mar, 2021 6 commits
-
-
Kenny Yu authored
Summary: This adds the ability to print the async stack trace from where the exception is thrown. Reviewed By: yfeldblum Differential Revision: D26989150 fbshipit-source-id: 2edfadfa617d407df947987d962617129d626040
-
Yedidya Feldblum authored
Summary: Add some functions that can be used to inspect the generated code for `FOLLY_SAFE_CHECK` and `FOLLY_SAFE_PCHECK`. Reviewed By: swolchok Differential Revision: D26996102 fbshipit-source-id: 257f59d5904c319ed01e55cfd75939b41e55c53d
-
Shai Szulanski authored
Summary: Task forces a copy of the passed-in token even when it's an rvalue, which results in two unnecessary atomic operations on the shared state. Take by value to allow moving. AsyncGenerator already does this. Reviewed By: yfeldblum Differential Revision: D26991772 fbshipit-source-id: 4697e36626158155329306928cbd1e7e69b8bd01
-
Adam Simpkins authored
Summary: This makes it possible to pass `FixedString` objects to APIs that accept `std::string_view`. `FixedString` already had implicit conversion to `std::string` and `folly::StringPiece`, this simply implements parity for `string_view`. Reviewed By: yfeldblum Differential Revision: D26940391 fbshipit-source-id: 5f411ef9a901e0855593b090f1cbe3345971a140
-
Lucian Grijincu authored
Summary: `folly::Symbolizer` uses `FOLLY_SAFE_CHECK` -- which is signal-safe, but it only says "this thing broke". I plan to changes these to add more details about what exactly broke: from: FOLLY_SAFE_CHECK(die.abbr.tag == DW_TAG_compile_unit, "expecting compile unit entry"); to FOLLY_SAFE_CHECK(die.abbr.tag == DW_TAG_compile_unit, "expecting compile unit entry, found: ", die.abbr.tag); Reviewed By: yfeldblum Differential Revision: D25992552 fbshipit-source-id: ae678b45606afc519704767844a973d499c60c73
-
Christian Watson authored
Differential Revision: D26612326 (https://github.com/facebook/folly/commit/28799ed1d609bb1aca82464be8ad9dbf4e9f1b39) Original commit changeset: d56c892c87ba fbshipit-source-id: 77f8a7c58bfced197558ed29912ace457a089baa
-
- 11 Mar, 2021 5 commits
-
-
Roger Kim authored
Summary: We have found that BitVectorCoding.h incorrectly outputs -Wdivision-by-zero errors when another file that includes it fails to compile. In the absence of other compilation errors, the -Wdivision-by-zero error does not appear (since the compiler correctly can tell that "division by zero" is not an issue in the code). In order to get rid of these erroneous error logs, we decided to replace the if-statements that surround the divisions (and check that the divisor is not zero) with `if constexpr` statements since those will stop the compiler from mistakenly thinking that division by zero is possible. Reviewed By: ot, philippv, luciang Differential Revision: D26961916 fbshipit-source-id: f65ef6d7782c94e58d6d28b9f8b053f205e3b7c1
-
Srivatsan Ramesh authored
Summary: Using a separate queue for server replies without any limit on the number of items read at once. Differential Revision: D26612326 fbshipit-source-id: d56c892c87bafa701c12b6da780e9b2d4710ee2c
-
Giuseppe Ottaviano authored
Summary: `to<T>` already works in simple cases when `IsSomeString<T>`; by generalizing `parseTo` any string-like `T` gets full functionality without having to copy-paste the overload. Reviewed By: yfeldblum Differential Revision: D26831450 fbshipit-source-id: c09629bb7173dde1e0986654128b8e1d7c48b9ba
-
Brandon Schlinker authored
Summary: `net_tstamp.h` is incomplete on some platforms, particularly OSS. One option would be to make `FOLLY_HAVE_SO_TIMESTAMPING` conditional on all of the timestamp flags being present. However, I'm instead going to just decouple this support from the underlying platform's headers. Reviewed By: rsunkad Differential Revision: D26971541 fbshipit-source-id: 01b24f57ab827aca42889138e4cca4d488ae0940
-
Lee Howes authored
Summary: Remove the default argument for the deprecated createUnique operation for SerialExecutor. Reviewed By: yfeldblum Differential Revision: D26916321 fbshipit-source-id: e6fb1766bfaae4d6e702982c5527d483e6d8c036
-
- 10 Mar, 2021 4 commits
-
-
Yedidya Feldblum authored
Summary: Under gcc and clang, we use the intrinsic `__builtin_clzll`. This builtin is available regardless of whether the `clz` instruction is available on the target platform - when it is, the backend chooses it; when it is not, the backend emits emulation code. Under msvc, the builtin is `__lzcnt64`. However, this builtin is available only in x64 builds; there is no fallback to emulation code, and 32-bit builds fail to compile. Differential Revision: D26918251 fbshipit-source-id: a4d9c199f632c5a210bd6fd8782d327f7aac774e
-
Jason Fried authored
Summary: In the long term I want to force all usage of get_executor to require that the call comes from a running asyncio eventloop as its safer/saner than allowing the default un-running loop to be used since it may never actually run. Until then I have created get_running_executor that I can use in various places. When get_running_executor(True) is used everywhere we can codemod it back to get_executor() and have asyncio.get_running_loop() used exclusively. A folly::IOBuf can be built around a Python Buffer. It supports three ways to ask python to cleanup that buffer. 1. If it has the GIL just decref the buffer 2. else if it has a Python Executor it can schedule the cleanup 3. it can rely on some cPython magic called "Py_AddPendingCall" thrift-py3 deserialize wraps a python buffer in a IOBuf, but since ownership is not handed off to C++ it has the GIL when we destroy the IOBUF so it doesn't need an Executor. IOBuf calls folly.executor.get_executor() which will create a AsyncioExecutor and bind it to the default eventloop. So using deserialize right before a python fork, would cause a ABORT in the child since the AsyncioExecutor would try to drive() itself during its destruction. The asyncio default eventloop is considered a bad thing, new interfaces like asyncio.run() does not rely on a default loop but creating its own. To insure we only ever use the eventloop from a running loop, use get_running_loop. Reviewed By: sdunster Differential Revision: D26794162 fbshipit-source-id: 8e7e53c453c9ccff7e81f02e0692c8bebad70edd
-
Zhengxu Chen authored
Summary: Just capture ms value for XLOG_EVERY_MS since it's executed inline. The use case here is we need to pass a non constant value as the milliseconds param, e.g: ``` XLOG_EVERY_MS(INFO, configValue) << msg; ``` Reviewed By: yfeldblum, simpkins Differential Revision: D26746623 fbshipit-source-id: 849ad9a20ff4088ffb5a2df99c9c424592b47867
-
Yedidya Feldblum authored
Summary: The fallback implementation of F14 does a clever trick in its implementation of `find()` to support heterogeneous lookup. But this trick is UB and its implementation assumes that the key-equal type is empty, not specially-aligned, and not final. Relax these constraints. As it turns out, fbthrift streaming uses an F14 map with a stateful key-equal, triggering this UB in the fallback implementation: `StreamMap` uses key-equal type `StreamMapEquals`, which is nonempty and has a `StreamIdResolver` field, which itself is empty but which causes `StreamMapEquals` not to be empty. The simplest fix is, of course, to switch to using `StreamIdResolver` as a base, but this would be a bug in the F14 fallback regardless. `BottomKeyEqual` must have the same size, alignment, emptiness, and finality as `KeyEqual`. Reviewed By: aary Differential Revision: D26905527 fbshipit-source-id: 023feb3963fc7b2e779fb591e737ea4b70ded476
-
- 09 Mar, 2021 5 commits
-
-
Alex Snast authored
Summary: Heterogeneous access is described [here](https://github.com/facebook/folly/blob/master/folly/container/F14.md#heterogeneous-key-type-with-transparent-hash-and-equality) and this diff adds this capability to EvictingCacheMap. See `HeterogeneousAccess` test from EvictingCacheMapTest.cpp for usage example. Reviewed By: yfeldblum Differential Revision: D26879601 fbshipit-source-id: 027352f2daa6773ab981b924732e1056550f6ea2
-
Tom Kwong authored
Summary: This diff adds new capability to calculate statistics efficiently in a single pass. In particular, it uses Welford's algorithm to track an internal state such that variance and standard deviation can be obtained at O(1). The following statistics are available: - count - minimum - maximum - mean - sample and population variance - sample and population standard deviation Reviewed By: yfeldblum Differential Revision: D26667517 fbshipit-source-id: c4eb31e93646b9cff2f6516039170c8d88a5bf33
-
Philip Pronin authored
Summary: Version of `GENERATOR` that we're already using in a few places where it doesn't leave its original scope. Reviewed By: ddrcoder, luciang Differential Revision: D26909115 fbshipit-source-id: 5fbae8bd44c62d4d96427a4fd3ef60a8d9cb40e3
-
Alan Frindell authored
Summary: All dependencies have migrated to folly/io/coro/Transport.h Reviewed By: yairgott Differential Revision: D26837064 fbshipit-source-id: abc46819e4d9bdec6ff5898d0295731781c7925d
-
Alan Frindell authored
Summary: This also renames the file and creates a Socket.h shim for compatabilty. Reviewed By: yairgott Differential Revision: D26837068 fbshipit-source-id: 47c8f7b410540d1ad0aa03f4bc96816f8a93ef1c
-