- 30 Mar, 2021 2 commits
-
-
Dan Melnic authored
Summary: Add IOBuf multi create/destroy benchmark Reviewed By: mokomull Differential Revision: D27406019 fbshipit-source-id: 001cd92743892bb91111831044fc3a4d3b02aaf7
-
Yedidya Feldblum authored
Summary: Rename, mark as kept, add a version taking an argument Differential Revision: D27383132 fbshipit-source-id: 214af5b09e42159756e97b3b829ac9ecb237c17b
-
- 29 Mar, 2021 7 commits
-
-
Dan Melnic authored
Summary: IOBuf allocate SharedInfo in the same allocation only if we do not cross into the next class size Reviewed By: jrahman Differential Revision: D27353914 fbshipit-source-id: 65be3641d7eaa0588bf26101ce02668fb827eee9
-
Pranjal Raihan authored
Summary: `folly::observer::ReadMostlyAtomicObserver` docblock explains it well: ``` /** * A ReadMostlyAtomicObserver guarantees that reading is exactly one relaxed * atomic load. Like AtomicObserver, the value is cached using `std::atomic`. * However, there is no version check when reading which means that the * cached value may be out-of-date with the Observer value. The cached value * will be updated asynchronously in a background thread. * * Because there is no version check when reading, ReadMostlyAtomicObserver * does not capture observer dependencies when used from makeObserver. It is not * possible to create a dependent observer. Therefore, ReadMostlyAtomicObserver * models none of CopyConstructible, MoveConstructible, CopyAssignable, or * MoveAssignable. Dependent observers should be created using the underlying * observer. * * ReadMostlyAtomicObserver is ideal for fastest possible reads on a * trivially-copyable type when a slightly out-of-date value will suffice. It is * perfect for very frequent reads coupled with very infrequent writes. */ ``` Other minor changes: * Added `getUnderlyingObserver` to each of the special-purpose observers. * Sprinkled `std::move` where neccessary. Reviewed By: yfeldblum Differential Revision: D27381490 fbshipit-source-id: fed039ae481af0c4e4148f80df03e30a125e333f
-
Ruslan Sayfutdinov authored
Summary: This page says it can't be greater than 256: https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-gethostname POSIX one is equal to 255, so set it to 255. Reviewed By: yfeldblum Differential Revision: D27370716 fbshipit-source-id: 458ebc02d2914a0422862fafedd089e0c13c5e6d
-
Pedro Eugenio Rocha Pedreira authored
Summary: Adding libicu manifest, which will be used by f4d/velox Reviewed By: amitkdutta Differential Revision: D25934666 fbshipit-source-id: 247d9961c90fcfc497498b556626e9ef1739b191
-
Doug Huff authored
Summary: Alias `-h` to `--help` because we live in a society. Reviewed By: yfeldblum Differential Revision: D27370742 fbshipit-source-id: eb346546fe4066eef62313176ff7e47c20e507be
-
Jianfeng Tang authored
Summary: As titled. Convert float to int explicitly to get rid of compilation warning. Reviewed By: therealgymmy Differential Revision: D27364578 fbshipit-source-id: a5f53142be9ba64260e7028d29c89a857ed66770
-
Ruslan Sayfutdinov authored
Summary: `LLVM_COROUTINES` define indicates that LLVM compatible `<experimental/coroutine>` is available and we can enable coroutines for Clang on Windows. Reviewed By: yfeldblum, WillerZ Differential Revision: D26729942 fbshipit-source-id: 37999a9a727727aa9244e8d4d67f035fc311be50
-
- 28 Mar, 2021 3 commits
-
-
Dan Melnic authored
Summary: SharedMutex TSAN: call destroy only if the annotation was created (Note: this ignores all push blocking failures!) Reviewed By: yfeldblum Differential Revision: D27379654 fbshipit-source-id: 90be62eb9e932c83e025a96dd36c4cba992e6267
-
Lucian Grijincu authored
Summary: Add API equivalent to `std::optional::value_or`: https://en.cppreference.com/w/cpp/utility/optional/value_or Returns the contained value if *this has a value, otherwise returns default_value. template< class U > constexpr T value_or( U&& default_value ) const&; Equivalent to `bool(*this) ? **this : static_cast<T>(std::forward<U>(default_value))` template< class U > constexpr T value_or( U&& default_value ) &&; Equivalent to `bool(*this) ? std::move(**this) : static_cast<T>(std::forward<U>(default_value))` Reviewed By: yfeldblum Differential Revision: D27346319 fbshipit-source-id: 598b740cb9068cffb0cc0fbda3579e64fd125e8b
-
Giuseppe Ottaviano authored
Summary: Even in debug mode, the branch can likely be coalesced with the actual condition if inlined. Reviewed By: yfeldblum Differential Revision: D27285173 fbshipit-source-id: 1662588f82d14a5ab2c9564bab5cec72981418ec
-
- 26 Mar, 2021 5 commits
-
-
Pedro Eugenio Rocha Pedreira authored
Summary: Folly builds are broken in Legocastle MacOS because there's no Elf support, but, since libdwarf is found (`-- Setting FOLLY_HAVE_DWARF: TRUE`), folly tries to compile Dwarf symbolizer which depends on a few symbols from Elf, which is not available, failing the compilation: https://www.internalfb.com/intern/sandcastle/log/?instance_id=4503600026654665&step_id=4503603563228601&step_index=49&name=Build%20folly Adding a check to make sure both Dwarf and Elf are available before compiling Dwarf symbolizer. See post for more details https://fb.workplace.com/groups/fbcode/permalink/3847861398584004 Reviewed By: chadaustin Differential Revision: D27328940 fbshipit-source-id: b06b852a8819275f63c57eb921562ecf37d0e63f
-
Ivan Egorov authored
Reviewed By: yfeldblum Differential Revision: D27261361 fbshipit-source-id: a3aa0b40d1a42313fbeeea5c8ca8f6d43dbc6bdf
-
generatedunixname89002005325676 authored
Reviewed By: zertosh Differential Revision: D27356622 fbshipit-source-id: f03ad23a2847b3cbaf61e16055393cbbfbc215ae
-
Alex Hornby authored
Summary: Add a test target to the eden_scm getdeps manifest and underlying Makefile Reviewed By: markbt Differential Revision: D27336805 fbshipit-source-id: 07ec4be1ff03c6a384451ce138d88938dd4bf86e
-
Yedidya Feldblum authored
Summary: A note describing some ways compilers infer unlikeliness. Reviewed By: iahs Differential Revision: D27298067 fbshipit-source-id: c2e0409aa6f0e95f6e68724f56a0e53a47d9a19e
-
- 25 Mar, 2021 5 commits
-
-
Andrew MacDonald authored
Summary: Posix does not require fsync to be provided, so define it as a local empty function when is it is not available Reviewed By: yfeldblum Differential Revision: D27243532 fbshipit-source-id: e7a9c31312e288458a9dc11736b238a378671caf
-
Ivan Egorov authored
Reviewed By: yfeldblum Differential Revision: D27260961 fbshipit-source-id: a2161e4e909531518f523fd611b109f7021ae258
-
Adam Ernst authored
Reviewed By: LeeHowes Differential Revision: D27302462 fbshipit-source-id: 8af6a8106563ded80de8ece803589fa07cc59241
-
Ivan Egorov authored
Reviewed By: yfeldblum Differential Revision: D27260808 fbshipit-source-id: b15bcfea70f0ad5d92df3b1143ef417eb2b4adf9
-
Alfred Perlstein authored
Summary: On some WIN32 platforms #defines `timezone` as such we get a compilation error due to name collision. To fix let's use a folly_ prefix on our polyfill. Reviewed By: yfeldblum Differential Revision: D27220643 fbshipit-source-id: ccd4fa971388d53b8c5e8fba9f217776573ea370
-
- 24 Mar, 2021 6 commits
-
-
TJ Yin authored
Summary: This diff added conversion from `IOBufQueue` and `QueueAppender` to `RWCursor`. It's safe to use `RWCursor` to mutate the their underlying `IOBuf` since the structure of `IOBuf` won't changed. It's worth noting appending data to `IOBufQueue` will invalidate RWCursor (just like iterator). Reviewed By: yfeldblum Differential Revision: D27257697 fbshipit-source-id: 17887d656a6095afe1c6882426457b9e75a66c84
-
Michel Salim authored
Summary: On glibc > 2.33 (e.g. on Fedora rawhide/35), `SIGSTKSZ` is no longer constant: http://sourceware-org.1504.n7.nabble.com/PATCH-sysconf-Add-SC-MINSIGSTKSZ-SC-SIGSTKSZ-BZ-20305-td650948.html Assume it's non-constant, and so: - use `std::max` rather than `folly::constexpr_max` to compute the stack size - cast both arguments to `size_t` since in the non-constant case we get a `long int` back - use `std::unique_ptr<char[]>` and compute the size at the time of use rather than make it class-wide Reviewed By: yfeldblum Differential Revision: D27143320 fbshipit-source-id: 7dcdd7cf3d5e96db605266504f443cf2b48ba18c
-
Srivatsan Ramesh authored
Summary: Using folly::Function as node type for EventBaseAtomicNotificationQueue involves two mallocs (for creating the function and also to create the queue node). In this diff, I have created a class to hold the data required to send replies and using emplaceMessage to add to the queue. Differential Revision: D26778920 fbshipit-source-id: 2dcf8395dc77db1d7c73d1d68c9a69e767191b95
-
Alexander Sklar authored
Summary: `std::is_pod` is deprecated in c++20, using `is_trivially_copyable` instead Pull Request resolved: https://github.com/facebook/folly/pull/1542 Reviewed By: Mizuchi Differential Revision: D27214088 Pulled By: yfeldblum fbshipit-source-id: 3cc6e29e16a1568cf1e9bbb73152e7bc2179f5d6
-
Ruslan Sayfutdinov authored
Summary: Fix clang internal error on Windows. Reviewed By: yfeldblum Differential Revision: D26994868 fbshipit-source-id: 97fe79231fcbfc0fc6712626dee8e1d570dd0dd6
-
Yedidya Feldblum authored
Summary: Since it is documented as async-signal-safe. V.s. importing from `folly/Conv.h`. Reviewed By: Orvid Differential Revision: D27221887 fbshipit-source-id: 9dbe866be84632f8f50f2e00c91697cc39f0b304
-
- 23 Mar, 2021 4 commits
-
-
Srivatsan Ramesh authored
Summary: putMessage() function takes variable number of arguments required to construct the queue node. Differential Revision: D26785602 fbshipit-source-id: 0a9bc711bf75a83397e6de3764c41d316ef64d89
-
Andrew Krieger authored
Summary: Existing accessors on dynamic are cumbersome when operating on dynamics that have optional keys or nullable values. Safely accessing these ends up in very bloated or ugly client code, even when using getDefault(). Additionally, the move semantics of `dynamic` are usually inferred based on the cv-ref qualification of the dynamic, and results in inconsistent syntax depending on the situation. `dynamic_view` attempts to resolve these issues by providing a new and explicit API for traversing and accessing a `dynamic`. The main new API is `descend`, which takes a varags list of keys and, functionally, repeatedly applies `operator[]` and either returns a view of the resulting value or an empty view if it doesn't exist or a type error occured during descent. It only throws if another unexpected exception occurs. `const_dynamic_view` contains copying accessors which will not throw on a type mismatch, or if invoked on an empty view, but instead will return a mandatory default value provided by the caller. The other new API is only provided by the non-const `dynamic_view` class. It is a set of value accessors which explicitly move the underlying value out of the viewed dynamic. There is a specialization for string values and a generic version for `dynamic`. A helper method, `folly::make_dynamic_view` is provided which determines the appropriate variant for a given dynamic ref. `friend` access to `dynamic` allows optimized checks and accesses over the regular `dynamic` APIs. Reviewed By: yfeldblum Differential Revision: D4917260 fbshipit-source-id: a07d26ed502aa22a5f19dd8521373a9e83fd6c02
-
Andrii Grynenko authored
Summary: This is a basic implementation of adaptors for coro::Task and coro::AsyncGenerator that are compatible with https://doc.rust-lang.org/std/future/trait.Future.html and https://docs.rs/futures/0.3.13/futures/stream/trait.Stream.html. Note that this performs blocking cancellation which may result in long destruction time/or even deadlocks if a given Task/AsyncGenerator doesn't support inline cancellation. Reviewed By: Imxset21, c-ryan747 Differential Revision: D26938974 fbshipit-source-id: fd043304441931c6f7aa078a1a5fee50ebfa2e90
-
Udip Pant authored
Summary: submitted by mchtech in https://github.com/facebookincubator/katran/pull/117 Reviewed By: sharmafb Differential Revision: D27224983 fbshipit-source-id: f427f91a94ee35a48f66330e17cd56b4f9ce22c6
-
- 21 Mar, 2021 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Let `assume` be invocable anytime, including before and after `main` and in signal handlers, by switching from `CHECK` to `FOLLY_SAFE_CHECK`. Requires further minimizing the deps of `FOLLY_SAFE_CHECK`. Reviewed By: ot, Orvid, luciang Differential Revision: D6636035 fbshipit-source-id: 026b15ea92ba37acf9b11d714d834b79da80936a
-
- 19 Mar, 2021 6 commits
-
-
Kenny Yu authored
Summary: Depending on the environment, the type definition for `struct pthread` (pthread implementation detail for `pthread_t`) may not be available in gdb. If this happens, use a predefined offset for linux x86_64 to find the `specific` field inside `struct pthread` that holds the thread-local storage values. Reviewed By: yfeldblum Differential Revision: D27112799 fbshipit-source-id: 38c88210c3cd2a6b06918de33167d862f59a676e
-
Kenny Yu authored
Summary: This fixes the gdb script to handle folly_async_stack_root_tls_key being uninitialized -- this means that no async operation has run on this thread previously. This also catches any errors raised by the `co_bt` command to help with debugging the script itself, and to allow `thread apply all co_bt` to process all threads, even if one thread has an error. Reviewed By: yfeldblum Differential Revision: D27180105 fbshipit-source-id: d6b36bdbc11b94a2f956862fc7651376e1d28af0
-
Yedidya Feldblum authored
Reviewed By: iahs Differential Revision: D27036059 fbshipit-source-id: 15166a6e7ec58d873a1d6799a3b1eb1ad64de420
-
Srivatsan Ramesh authored
Summary: Using a separate queue for server replies without any limit on the number of items read at once. Differential Revision: D27090888 fbshipit-source-id: 9df44322e63a3f351a6ab4e723ead083a874b705
-
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 1 commit
-
-
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
-