- 05 May, 2021 1 commit
-
-
Andrii Grynenko authored
Summary: GCC seems to be generating incorrect code for some mix of co_invoke and start/startInline. This workaround makes coro tests pass. Reviewed By: yfeldblum Differential Revision: D28174118 fbshipit-source-id: b8178d7711ed5619a37c169f8f18dd125bf08f0b
-
- 04 May, 2021 8 commits
-
-
Maged Michael authored
Summary: Replace DCHECK(tagged_empty()) with a warning. The rationale is that the DCHECK was intended to help higher level users detect memory leaks, but since the DCHECK fails at domain destruction, the stack trace is not really helpful to users. By changing it to a warning, at least the user gets a hint that there may be a leak of object(s) that use hazptr_obj_cohort (e.g., ConcurrentHashMap, RequestContext). Reviewed By: yfeldblum Differential Revision: D28145864 fbshipit-source-id: 8a79e25efd21f0b1d713202f2fe8954c17a7d4de
-
Srivatsan Ramesh authored
Summary: Fix for the proxygen fuzz [build error]( https://oss-fuzz-build-logs.storage.googleapis.com/log-e58a42bb-98c0-4643-b842-b06f708eba12.txt) introduced by D27384053 (https://github.com/facebook/folly/commit/cdf0badc831c3aed7a740185d23728f779be8ba7) Reviewed By: yfeldblum, lnicco Differential Revision: D28154352 fbshipit-source-id: 6d98d9a3c9064de8f70506425dd790aa0cc3d9a6
-
Mark Santaniello authored
Summary: Suppose we have this: ``` void myBenchmark() { do_setup(); do_processing(); } ``` Maybe we want to benchmark both including and excluding the setup. Today, we have some options: One possibility: ``` void myBenchmarkIncludeSetup() { do_setup(); do_processing(); } void myBenchmarkExcludeSetup() { BENCHMARK_SUSPEND { do_setup(); } do_processing(); } ``` Another possibility -- but this is pretty verbose: ``` void myBenchmark(bool exclude_setup) { BenchmarkSuspender bs; bs.dismiss() if(exclude_setup) bs.rehire(); do_setup(); if(exclude_setup) bs.dismiss(); do_processing(); } ``` We can simplify if we no longer require that BenchmarkSuspenders begin life as "hired". After this diff, we can instead do this. I think it reads better: ``` void myBenchmark(bool exclude_setup) { BenchmarkSuspender bs{BenchmarkSuspender::Dismissed}; if(exclude_setup) bs.rehire(); do_setup(); if(exclude_setup) bs.dismiss(); do_processing(); } ``` Reviewed By: yfeldblum, ot, luciang Differential Revision: D28151318 fbshipit-source-id: bca5a41158430844748a812bbe30173adbad5307
-
Yedidya Feldblum authored
Summary: Ideal for dependent return types to be calculated in the template param list rather since the putting them in the leading or trailing return type slot makes the function name opaque to demangling. Reviewed By: Orvid Differential Revision: D28140885 fbshipit-source-id: 0f9bc182f12a6383205863ce9a79b01961d644a6
-
REDMOND\agnel authored
Summary: Currently to_ascii_port_clzll() in ToAscii.h always returns 0 in x86. This switches to __builtin_clzll() backed by a polyfill. Closes https://github.com/facebook/folly/issues/1566. Pull Request resolved: https://github.com/facebook/folly/pull/1567 Reviewed By: luciang Differential Revision: D28162903 Pulled By: yfeldblum fbshipit-source-id: 1872cda7aa155b84086bd15ad6cd40475eeb0ac4
-
Yedidya Feldblum authored
Summary: Best to use C++ syntax `thread_local` instead since it is language-native and cross-platform. Reviewed By: Orvid Differential Revision: D27671626 fbshipit-source-id: 8ef0c487bfa20ab323067c05862998df25d2a53b
-
Yedidya Feldblum authored
Summary: The port is not accessed in such a state, but nevertheless zero it. Differential Revision: D28155314 fbshipit-source-id: 0ee6a617be5de66d1e068c242d52423adb31f486
-
Yedidya Feldblum authored
Differential Revision: D28163554 fbshipit-source-id: 2167a39e88f7aa6053dea5119a30947d2f3304f3
-
- 03 May, 2021 1 commit
-
-
Dan Melnic authored
Summary: Add support for AsyncUDPSocket SO_BINDTODEVICE Reviewed By: danobi Differential Revision: D28100917 fbshipit-source-id: bcc66d943342cbd40b634ef095eccf3e599fcb65
-
- 02 May, 2021 4 commits
-
-
Yedidya Feldblum authored
Summary: Revise all overloads of `folly::exceptionStr` in terms of `type_info_of`, `exception_ptr_get_type`, and `exception_ptr_get_object`. No longer rely on `catch_exception` and no longer have inline preprocessor conditionals. Reviewed By: Orvid, luciang Differential Revision: D26333081 fbshipit-source-id: 318ce83b9f15a12d5a33f528134e6fb38bb78a62
-
Yedidya Feldblum authored
Summary: The table is large while the array is small. Reviewed By: luciang Differential Revision: D27986020 fbshipit-source-id: b6896514408758c592e2b74d801e38f217163f61
-
Yedidya Feldblum authored
Summary: Introduce functions `exception_ptr_get_type`, `exception_ptr_get_object` for inspecting and upcasting the content of `std::exception_ptr`. Since these facilities are not exposed in any standard way, reach into the platform abi/runtime to implement them. Includes implementations for these platforms: * libstdc++ * libc++ * win32 Reviewed By: mzlee, luciang Differential Revision: D26306199 fbshipit-source-id: 3b655476b69f4456f4e4f88135fbba70a8c4a2a6
-
Yedidya Feldblum authored
Reviewed By: Orvid Differential Revision: D27671636 fbshipit-source-id: 82cab152ecb606235ee66c026ecafecfe52a88a5
-
- 01 May, 2021 1 commit
-
-
Kenny Yu authored
Summary: This correctly walks the async stack traces. Previously, we were not following the async stack root from the last async stack frame. High level stack walking strategy is as follows: 1) Start walking the normal stack up to the first normal stack frame holding the first async stack root 2) Walk the async stack frame chain from the provided async stack root 3) When we reach the end of the current async stack frame chain, check if the last async stack frame references an async stack root R1. If there is one, use R1 to find the start of the next normal stack frame when walking the normal stack frame. 4) If that async stack root R1 has a next async stack root R2, the normal stack frame walk should end at the normal stack frame holding the next async stack root R2. Otherwise the normal stack frame walk should continue all the way until it hits nullptr. 5) The next async stack walk should begin at the top async frame referenced by the next async stack root R2. 6) Repeat until we've reached the end of both the normal and async stack frame chains. Reviewed By: andriigrynenko Differential Revision: D28102128 fbshipit-source-id: c412a2a253720867c257d5cbaa9a6b22e96154f2
-
- 30 Apr, 2021 7 commits
-
-
Yedidya Feldblum authored
Reviewed By: Orvid Differential Revision: D27671208 fbshipit-source-id: 44710468544eebbb8f4ed0ecd5621bce0b56d248
-
Yedidya Feldblum authored
Summary: It is monomorphized but called rarely. Best to optimize for size. The `UniqueInstance` ctor is currently called in the constructor of each translation unit for each distinct instance of `SingletonThreadLocal`. `UniqueInstance` may be extended to more use-cases so it is worthwhile optimizing for size. Reviewed By: luciang Differential Revision: D27602938 fbshipit-source-id: e4077830544516219485814ccc48805b7bb38e34
-
Vishal Sahu authored
Summary: Need this to migrate CO_TEST using FAIL() fully on coroutines. Reviewed By: ispeters Differential Revision: D28099628 fbshipit-source-id: c79658809210184d8895c3d1551e04b1baf88cae
-
Yedidya Feldblum authored
Summary: To reduce build size, avoid creating unnecessary functions. If the provided callable is already a function-pointer, the callee will already not be inlined. Differential Revision: D27984345 fbshipit-source-id: a5a31330541338eb04e802bd9dafd99188af3ab9
-
Yedidya Feldblum authored
Summary: Some older versions of gcc cannot deduce the relevant types correctly, and they are still in use in corners of the codebase. Differential Revision: D28111907 fbshipit-source-id: 0367cb102f450f0f601350308a5831c7fd68f775
-
Yedidya Feldblum authored
Differential Revision: D27582896 fbshipit-source-id: e4228117ba02fe18bd6e8964640f293c963a8732
-
REDMOND\agnel authored
Summary: Fixes warnings about implicit type truncation. By making the conversions explicit, react-native-windows will be able to remove suppressions for several warnings required per SDL. Pull Request resolved: https://github.com/facebook/folly/pull/1565 Reviewed By: igorsugak Differential Revision: D27964258 Pulled By: yfeldblum fbshipit-source-id: b13f8728ecda0b38c2fd661199d6551c5ff87993
-
- 29 Apr, 2021 4 commits
-
-
Yedidya Feldblum authored
Summary: Complex expressions involving certain tokens parse at preprocessor time as multiple preprocessor arguments. Quite awkward. The trick is to change the preprocessor macro to deal in variadic arguments. Reviewed By: ot, Orvid, luciang Differential Revision: D27986071 fbshipit-source-id: a126fca260396418b14b7367e3e41ddeea78b7af
-
Srivatsan Ramesh authored
Summary: QueueMessage is now a variant of NewConnMessage and ErrorMessage Reviewed By: praihan Differential Revision: D27384053 fbshipit-source-id: a92f514b56f31e879dc329984bf0a615ed339836
-
Yedidya Feldblum authored
Differential Revision: D27582476 fbshipit-source-id: 376fecda16de8a4836f9ba5196701a9045799ce7
-
Yedidya Feldblum authored
Summary: So that it is possible to have both `Foo<K0, K1, X, Y>` and `Bar<K0, K1, A, B>` where both `Foo` and `Bar` use `UniqueInstance`. Differential Revision: D27600228 fbshipit-source-id: a5d58726ea0009d7a45c0234f9cff723662a4604
-
- 28 Apr, 2021 1 commit
-
-
Lee Howes authored
Summary: Parameterises CPUThreadPoolExecutor to allow us to construct one that prohibits blocking operations on its threads. The flag is stored as a thread local and applied using a scoped guard. Reviewed By: yfeldblum Differential Revision: D27893465 fbshipit-source-id: 71af1c0b7c23752f499712f498b6abb58a345979
-
- 27 Apr, 2021 3 commits
-
-
Philip Pronin authored
Summary: Similarly to `IoUringOp::getSqe()`, expose underlying submission data structure. The end goal is to perform certain introspection in client code to report aggregated stats (number of IO, total size of IO, ...). Reviewed By: ot Differential Revision: D28022188 fbshipit-source-id: edc51420ed901f0a0d9b5b1338308ad680371298
-
Alex Eckert authored
Summary: I have a use case where I would like to check if the AsyncPipe is still active without pumping something in to write(). Could set up an onClosed callback, but this would introduce more complexity. This adds a function to determine if the queue inside the AsyncPipe still exists. Reviewed By: iahs Differential Revision: D28015007 fbshipit-source-id: 1ba37466218abd2f42eab1d8ea5677c3945e31f5
-
Alan Frindell authored
Summary: For TCP sockets, it may not be possible to query the peer address from the fd if the endpoint is no longer connected (closed with reset). In most server cases, the peer address is known when the connection is accepted, so it can be prepopulated. Reviewed By: mjoras Differential Revision: D27985942 fbshipit-source-id: 630098ac00930b978fe8a9cad1894834c44d4d93
-
- 26 Apr, 2021 3 commits
-
-
Igor Sugak authored
Summary: ``` folly/executors/InlineExecutor.h:29:11: error: '~InlineLikeExecutor' overrides a destructor but is not marked 'override' [-Werror,-Wsuggest-destructor-override] virtual ~InlineLikeExecutor() {} ^ folly/Executor.h:57:11: note: overridden virtual function is here virtual ~Executor() {} ^ In file included from tupperware/agent/system/Mounts.cpp:18: In file included from folly/futures/Future.h:36: In file included from folly/fibers/Baton.h:297: In file included from folly/fibers/Baton-inl.h:19: folly/fibers/FiberManagerInternal.h:588:10: error: 'timeoutExpired' overrides a member function but is not marked 'override' [-Werror,-Wsuggest-override] void timeoutExpired() noexcept { run(); } ^ folly/io/async/HHWheelTimer.h:95:18: note: overridden virtual function is here virtual void timeoutExpired() noexcept = 0; ^ In file included from tupperware/agent/system/Mounts.cpp:18: In file included from folly/futures/Future.h:36: In file included from folly/fibers/Baton.h:297: In file included from folly/fibers/Baton-inl.h:19: folly/fibers/FiberManagerInternal.h:589:10: error: 'callbackCanceled' overrides a member function but is not marked 'override' [-Werror,-Wsuggest-override] void callbackCanceled() noexcept {} ^ folly/io/async/HHWheelTimer.h:100:18: note: overridden virtual function is here virtual void callbackCanceled() noexcept { timeoutExpired(); } ^ 3 errors generated. ``` Reviewed By: simpkins Differential Revision: D27988235 fbshipit-source-id: 799484c52f89fa20f647ff0801b8d136b657b395
-
Lee Howes authored
Summary: Add a termination tag that carries through the blocking context chain. This flag notifies logging operations that they may go as far as to terminate the process if blocking operations are detected. The flags carry through the blocking scopes so the termination flag will stay present while we enable and disable blocking - it would be sticky for a given thread once set. Reviewed By: yfeldblum Differential Revision: D27869075 fbshipit-source-id: 27014a3e6c9b28c0f433949a576bb6116e7c06c0
-
Yedidya Feldblum authored
Summary: Internals are not portable between versions or across platforms. Reviewed By: Orvid Differential Revision: D27990286 fbshipit-source-id: b70d8d3f67a1e5262efa842f70817e3ae3972339
-
- 25 Apr, 2021 6 commits
-
-
Yedidya Feldblum authored
Reviewed By: Orvid Differential Revision: D27582035 fbshipit-source-id: 0f0c35adca1c44dcd0ef88f2443f769d7991e6aa
-
Yedidya Feldblum authored
Summary: Add a source file for the function bodies of `getThreadID` and `getOSThreadID`. Differential Revision: D27698463 fbshipit-source-id: 255961954b1be07e59b19ef3006dcd6149795861
-
Yedidya Feldblum authored
Summary: `folly/stats/StreamingStats.h` uses `std::min` and `std::max` so must `#include <algorithm>`. Reviewed By: Orvid Differential Revision: D27986054 fbshipit-source-id: 1c1160101e1ebb4e0b1a16d3d97fd2931db9eeb0
-
Yedidya Feldblum authored
Summary: `StaticSingletonManager::create<T, Tag>` is larger than necessary, which may not be desirable when using many tags with the same type. Permit call-sites to use static data to shrink the functions. Reviewed By: aary Differential Revision: D27863037 fbshipit-source-id: 9f6ced3e7d7a85b78e671f69d7a475ab4de5eea0
-
Yedidya Feldblum authored
Summary: By suppressing `-Wdeprecated-declarations` v.s. `-Wdeprecated`, which latter works only under clang. Reviewed By: Orvid Differential Revision: D27987616 fbshipit-source-id: 4bf2a225a65d8ac7c7555123343e9536759fcfcc
-
Igor Sugak authored
Summary: Reported by clang-12: ``` folly/test/SynchronizedTestLib-inl.h:587:7: error: expression result unused [-Werror,-Wunused-value] SYNCHRONIZED_DUAL(lv, v, lm, m) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ folly/Synchronized.h:1819:5: note: expanded from macro 'SYNCHRONIZED_DUAL' ::folly::detail::SYNCHRONIZED_macro_is_deprecated{}; \ ^ ~~ ``` Reviewed By: chadaustin Differential Revision: D27954777 fbshipit-source-id: bd1dba5ebf563b34b496457b980568ea1c978442
-
- 24 Apr, 2021 1 commit
-
-
Yedidya Feldblum authored
Reviewed By: Orvid Differential Revision: D27559485 fbshipit-source-id: be2db59ef6d9b4cf178216a4b8851e27e7ecef93
-