1. 04 Feb, 2022 6 commits
    • Alex Hornby's avatar
      set BOOST_ROOT_1_69_0 as well as BOOST_ROOT_1_78_0 · ef8accd5
      Alex Hornby authored
      Summary: CentOS Stream 8's cmake 3.20.2 boost rules don't find the system boost with just BOOST_ROOT_1_78_0 (make sense, the system boost is 1.69),  so set BOOST_ROOT_1_69_0 as well
      
      Reviewed By: chadaustin
      
      Differential Revision: D34000244
      
      fbshipit-source-id: 73df3b6b9f1c091fd70fd61bc7169c5f77ed632b
      ef8accd5
    • Yedidya Feldblum's avatar
      brace-initialize common invocables · 6c35a50b
      Yedidya Feldblum authored
      Summary: Not sure if necessary today, but some compilers have historically required this.
      
      Differential Revision: D33992255
      
      fbshipit-source-id: 14cec23d7e6d29f7f15934e27b004f002cac71ef
      6c35a50b
    • Harvey Hunt's avatar
      getdeps: Add support for brew packages and define package dependencies · c2270f28
      Harvey Hunt authored
      Summary:
      In order to speed up build times on a mac, add homebrew support to
      getdeps.
      
      Homebrew packages can be declared in a manifest using the `homebrew` header.
      
      Futher, ahornby has added manifest entries for homebrew packages which are
      included in this diff and also included a change to use the correct version of
      openssl. Without this openssl change, homebrew cmake configure finds an old
      openssl 1.0.2 install.
      
      This diff provides a 2x speed up for building folly:
      
      Timings for clean getdeps folly build on mid-2018 2.9Ghz i9 6 core intel macbook pro with 32GB RAM:
      
      With new homebrew system deps:
      ```
      rm -rf /Users/ahornby/.scratch/UsersZahornbyZfbsource/fbcode_builder_getdeps/
      time ./opensource/fbcode_builder/getdeps.py build --allow-system-packages folly
      real	17m39.329s
      user	76m10.317s
      sys	5m50.163s
      ```
      
      Without:
      ```
      rm -rf /Users/ahornby/.scratch/UsersZahornbyZfbsource/fbcode_builder_getdeps/
      time ./opensource/fbcode_builder/getdeps.py build folly
      real	32m10.344s
      user	105m53.448s
      sys	15m57.858s
      ```
      
      Reviewed By: ahornby
      
      Differential Revision: D33842632
      
      fbshipit-source-id: ac785d4a8dcfa31b77292bddd9e747022ac36e3b
      c2270f28
    • Alex Hornby's avatar
      allow expressions for shipit manifest entries · e711c040
      Alex Hornby authored
      Summary: Add expressions for shipit entries so that we can map different directories if needed
      
      Differential Revision: D33947996
      
      fbshipit-source-id: e765769ae5a6ab90055b63284e538b965d6071b3
      e711c040
    • Alex Hornby's avatar
      pick rust installation independently of --facebook-internal · 62fcc612
      Alex Hornby authored
      Summary: Create a new fbsource property for manifests so we can still use monorepo rust toolchain when running builds with --no-facebook-internal
      
      Differential Revision: D33945559
      
      fbshipit-source-id: 606af62e03d09c3529018af4478bcafecd0cd640
      62fcc612
    • Yedidya Feldblum's avatar
      fix calls to fmt::format with non-consteval format strings · 96978d34
      Yedidya Feldblum authored
      Summary: Newly a thing with `fmt` v8.
      
      Differential Revision: D33995623
      
      fbshipit-source-id: 4560f1498a8f8253ab572105a441b735d53d776f
      96978d34
  2. 03 Feb, 2022 10 commits
    • Chad Austin's avatar
      upgrade boost to 1.78.0 · 17d5b56c
      Chad Austin authored
      Summary: Boost 1.69 does not build on Fedora 35, so upgrade to Boost 1.78.
      
      Reviewed By: ahornby
      
      Differential Revision: D33855670
      
      fbshipit-source-id: 85469a835a1dab1a7d5222413b1f1349bdcff280
      17d5b56c
    • Genevieve Helsel's avatar
      restrict fbthrift python dependency to fix watchman-diag · 6f48553f
      Genevieve Helsel authored
      Reviewed By: singhsrb
      
      Differential Revision: D33982894
      
      fbshipit-source-id: 5ec3f1555a551f3931983fde844346293704231c
      6f48553f
    • Chad Austin's avatar
      don't follow mount points when applying shipit transformation · bfb70cac
      Chad Austin authored
      Summary:
      If a getdeps project creates a bind mount in a subdirectory, we don't
      want the shipit transformer to copy all of the bind mount's contents
      to the ship-transformed output.
      
      This manifested when I was using Vagrant inside of Watchman and
      `getdeps.py fetch watchman` would copy all of the Vagrant VMs too.
      
      Reviewed By: ahornby
      
      Differential Revision: D33855553
      
      fbshipit-source-id: e2bc50ecfe0d067490c95be05d074d6a844f30d5
      bfb70cac
    • Chad Austin's avatar
      upgrade cpptoml to a patched upstream · 50791b79
      Chad Austin authored
      Summary:
      cpptoml is unsupported and is missing an #include. Switch to a patched
      fork so we build on recent gcc, including Fedora 35.
      
      Reviewed By: xavierd
      
      Differential Revision: D33855455
      
      fbshipit-source-id: 48675a116fc1f53246c6bf206f1deee32bd7d6c3
      50791b79
    • Chad Austin's avatar
      prefetch projects in the background · 0c9a8d53
      Chad Austin authored
      Summary:
      There's no reason to block a getdeps build on prefetching its sources,
      so issue all prefetches in the background.
      
      Reviewed By: genevievehelsel
      
      Differential Revision: D33855396
      
      fbshipit-source-id: 1ba01b0587e9bc0e74e6bba5b8571af76bf2516d
      0c9a8d53
    • Dan Melnic's avatar
      Check before redefining TCP_ZEROCOPY_RECEIVE · 9ad7c2a8
      Dan Melnic authored
      Summary: Check before redefining TCP_ZEROCOPY_RECEIVE
      
      Reviewed By: henrywang8atfbdotcom, kevin-vigor
      
      Differential Revision: D33982730
      
      fbshipit-source-id: 1f6a6d95e247e0fe824d853c4504ef0bd17e76bf
      9ad7c2a8
    • Dan Melnic's avatar
      Call scheduleImmediateRead() outside of the loop · 09bcbb11
      Dan Melnic authored
      Summary: Call scheduleImmediateRead() outside of the loop
      
      Reviewed By: simpkins, kevin-vigor
      
      Differential Revision: D33981511
      
      fbshipit-source-id: d71cb9ac3f1f5eebae82195d5c93a2a90e80a636
      09bcbb11
    • Yedidya Feldblum's avatar
      lift Unexpected to the top of the file · 1c49e380
      Yedidya Feldblum authored
      Summary: To avoid unnecessary forward-declarations.
      
      Reviewed By: Gownta
      
      Differential Revision: D32015253
      
      fbshipit-source-id: be8d5db93aebcd187dad379cd59ec69e2e274731
      1c49e380
    • Dan Melnic's avatar
      Fix typo · 741d2636
      Dan Melnic authored
      Summary: Fix typo
      
      Reviewed By: yfeldblum
      
      Differential Revision: D33956691
      
      fbshipit-source-id: 49b0c59554eb1d45f856e2e2b2a3598f74715179
      741d2636
    • Yedidya Feldblum's avatar
      dispatch indirection for function exec · 23d4c5e2
      Yedidya Feldblum authored
      Summary:
      The type-erased Function is widely used with lambdas and the type of every lambda is unique. Template instantiations are costly for build speed so, for the parts of Function which interact with lambdas, we choose techniques to optimize build speed.
      
      In particular, we avoid the extra layer of constructor templates which must be overload-tested and instantiated. The existing design of the extra layer was clean - it effectively used tag-dispatch and was able to deduplicate code with the coercing constructor. However, the choice of techniques was not optimal for build speed.
      
      ```name=trunk
      $ foundation/scripts/run-perf-compile --syntax folly/futures/test/FutureTest.cpp
           6,407,492,259      instructions:uP
      ```
      
      ```name=branch
      $ foundation/scripts/run-perf-compile --syntax folly/futures/test/FutureTest.cpp
           6,303,165,111      instructions:uP
      ```
      
      Reviewed By: Gownta, ot, luciang
      
      Differential Revision: D32940920
      
      fbshipit-source-id: 742cb67b994e7c3e6c070254386f3cdf5dffa38c
      23d4c5e2
  3. 02 Feb, 2022 7 commits
    • Michael Voznesensky's avatar
      Expose cloneAsValue from IOBuf.h in cython IOBuf · 7e27b793
      Michael Voznesensky authored
      Summary: We need it for lego
      
      Reviewed By: yfeldblum
      
      Differential Revision: D33910794
      
      fbshipit-source-id: 2a326f8fc41baae0db68657331f93b3d8124b8d8
      7e27b793
    • Adam Gleitman's avatar
      fix: Flip signs in Time.h's Apple version checks (#1688) · 4a8837f3
      Adam Gleitman authored
      Summary:
      When trying to bring react-native-macos up to date with 0.66, I was running into an issue getting RNTester to compile due to an error regarding redefining `clockid_t`. Other people have been seeing similar issues as per [these search results](https://github.com/facebook/folly/issues?q=clockid_t).
      
      The history behind this appears to be as follows:
      
      Several declarations in `<time.h>` were not available on Apple platforms until macOS 10.12 and iOS 10, which is why Folly needs to check the minimum version and set `FOLLY_HAVE_CLOCK_GETTIME` as needed. The problem is, the current logic as it stands right now is to set `FOLLY_HAVE_CLOCK_GETTIME = 1` (which implies that we don't need to declare them ourselves as the OS provides them for us) if...
      * ...we're building for macOS, and the minimum required version is less than 10.12, or...
      * ...we're building for iOS, and the minimum required version is less than 10.
      
      However, this doesn't make any sense. This is saying that we don't need to declare these missing APIs if we could be compiling Folly for use on an older version (i.e., macOS 10.11/iOS 9 or earlier), which is totally wrong! Instead, we ought to be checking if the versions are *at least* macOS 10.12 or iOS 10.
      
      React Native currently works around this by eliminating the minimum version check entirely with [this PR](https://github.com/facebook/react-native/pull/32715/), which is certainly a valid local fix ([the minimum iOS version for React Native apps is currently iOS 11](https://github.com/facebook/react-native/blob/1b31d6bb582768ccbe92d3c1a9e43354a8c531e5/template/ios/Podfile#L4)), but doesn't solve the problem at its core. This PR does solve the problem.
      
      I have not tested building this with a minimum version below the above thresholds for use on a modern version of macOS/iOS, but considering the discussion in https://github.com/facebook/folly/issues/1545, I think we should be safe to ignore these older versions from now on.
      
      Pull Request resolved: https://github.com/facebook/folly/pull/1688
      
      Reviewed By: yfeldblum
      
      Differential Revision: D33483705
      
      Pulled By: Orvid
      
      fbshipit-source-id: 0fe7c556af7e5b79a7679f75d003cf81a8f412ce
      4a8837f3
    • Yicheng Wang's avatar
      remove temp directive in AsyncServerSocket · c6981b29
      Yicheng Wang authored
      Summary: ^
      
      Reviewed By: praihan
      
      Differential Revision: D33807636
      
      fbshipit-source-id: 0a0aaa533387284f758daf057529aaa7ddc3ce04
      c6981b29
    • Dan Melnic's avatar
      Add support for Linux TCP zerocopy RX · a02ba06a
      Dan Melnic authored
      Summary:
      Add support for Linux TCP zerocopy RX
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: simpkins
      
      Differential Revision: D32741177
      
      fbshipit-source-id: 412981fdd4a27437d6f22a80dc7c5fc864335ddf
      a02ba06a
    • Kenny Yu's avatar
      delete detail::getSingletonStackTrace · 886ed94b
      Kenny Yu authored
      Summary: This removes `detail::getSingletonStackTrace` in favor of `symbolizer::getStackTraceStr`.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D33783970
      
      fbshipit-source-id: 416ff70abb79ce4e9c3180c0872432ae2966effc
      886ed94b
    • Yedidya Feldblum's avatar
      recursive function · 9adda7dd
      Yedidya Feldblum authored
      Summary:
      Check that recursion builds with specific versions of gcc. Fix failures with that version.
      
      Addresses these failures:
      
      ```
      In file included from folly/test/FunctionTest.cpp:17:
      folly/Function.h: In substitution of 'template<class ReturnType, class ... Args> template<class F, class R> using IfSafeResult = folly::detail::function::IfSafeResultImpl<R, ReturnType> [with F = folly::Function<RecFolly()>; R = RecFolly; ReturnType = RecFolly; Args = {}]':
      folly/Function.h:761:7:   required by substitution of 'template<class Signature, class> folly::Function<RecFolly()>::Function(folly::Function<F>&&) [with Signature = RecFolly(); <template-parameter-1-2> = <missing>]'
      folly/Function.h:293:40:   required by substitution of 'template<class From, class To, class> using IfSafeResultImpl = decltype ((void)(static_cast<To>(declval<From>()))) [with From = RecFolly; To = RecFolly; <template-parameter-1-3> = void]'
      folly/Function.h:363:9:   required by substitution of 'template<class ReturnType, class ... Args> template<class F, class R> using IfSafeResult = folly::detail::function::IfSafeResultImpl<R, ReturnType> [with F = folly::Function<RecFolly()>; R = RecFolly; ReturnType = RecFolly; Args = {}]'
      folly/Function.h:761:7:   required by substitution of 'template<class Signature, class> folly::Function<RecFolly()>::Function(folly::Function<F>&&) [with Signature = RecFolly(); <template-parameter-1-2> = <missing>]'
      folly/Function.h:293:40:   required by substitution of 'template<class From, class To, class> using IfSafeResultImpl = decltype ((void)(static_cast<To>(declval<From>()))) [with From = RecFolly; To = RecFolly; <template-parameter-1-3> = void]'
      folly/Function.h:363:9:   [ skipping 501 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
      folly/Function.h:363:9:   required by substitution of 'template<class ReturnType, class ... Args> template<class F, class R> using IfSafeResult = folly::detail::function::IfSafeResultImpl<R, ReturnType> [with F = folly::Function<RecFolly()>; R = RecFolly; ReturnType = RecFolly; Args = {}]'
      folly/Function.h:761:7:   required by substitution of 'template<class Signature, class> folly::Function<RecFolly()>::Function(folly::Function<F>&&) [with Signature = RecFolly(); <template-parameter-1-2> = <missing>]'
      folly/Function.h:293:40:   required by substitution of 'template<class From, class To, class> using IfSafeResultImpl = decltype ((void)(static_cast<To>(declval<From>()))) [with From = RecFolly; To = RecFolly; <template-parameter-1-3> = void]'
      folly/Function.h:363:9:   required by substitution of 'template<class ReturnType, class ... Args> template<class F, class R> using IfSafeResult = folly::detail::function::IfSafeResultImpl<R, ReturnType> [with F = folly::Function<RecFolly()>; R = RecFolly; ReturnType = RecFolly; Args = {}]'
      folly/Function.h:761:7:   required by substitution of 'template<class Signature, class> folly::Function<RecFolly()>::Function(folly::Function<F>&&) [with Signature = RecFolly(); <template-parameter-1-2> = <missing>]'
      folly/test/FunctionTest.cpp:212:54:   required from here
      folly/Function.h:363:9: fatal error: template instantiation depth exceeds maximum of 512 (use '-ftemplate-depth=' to increase the maximum)
        363 |   using IfSafeResult = IfSafeResultImpl<R, ReturnType>;
            |         ^~~~~~~~~~~~
      compilation terminated.
      ```
      
      ```
      In file included from folly/test/FunctionTest.cpp:17:
      folly/Function.h: In member function 'virtual void Function_SelfMove_Test::TestBody()':
      folly/Function.h:709:70: error: 'f.folly::Function<int()>::exec_' is used uninitialized in this function [-Werror=uninitialized]
        709 |   Function(Function&& that) noexcept : call_(that.call_), exec_(that.exec_) {
            |                                                                 ~~~~~^~~~~
      folly/Function.h: In member function 'virtual void Function_SelfMove2_Test::TestBody()':
      folly/Function.h:709:70: warning: 'f.folly::Function<int()>::exec_' may be used uninitialized in this function [-Wmaybe-uninitialized]
        709 |   Function(Function&& that) noexcept : call_(that.call_), exec_(that.exec_) {
            |                                                                 ~~~~~^~~~~
      folly/Function.h: In member function 'virtual void Function_SelfStdSwap_Test::TestBody()':
      folly/Function.h:709:70: error: 'f.folly::Function<int()>::exec_' is used uninitialized in this function [-Werror=uninitialized]
        709 |   Function(Function&& that) noexcept : call_(that.call_), exec_(that.exec_) {
            |                                                                 ~~~~~^~~~~
      folly/Function.h:709:70: warning: 'f.folly::Function<int()>::exec_' may be used uninitialized in this function [-Wmaybe-uninitialized]
        709 |   Function(Function&& that) noexcept : call_(that.call_), exec_(that.exec_) {
            |                                                                 ~~~~~^~~~~
      folly/Function.h:709:70: warning: 'f.folly::Function<int()>::exec_' may be used uninitialized in this function [-Wmaybe-uninitialized]
        709 |   Function(Function&& that) noexcept : call_(that.call_), exec_(that.exec_) {
            |                                                                 ~~~~~^~~~~
      ```
      
      Notes:
      * For some versions of gcc, the compiler sees the converting-move-ctor as a better match than the actual move-ctor and this leads the compiler to infinite recursion; to work around this, explicitly exclude the same-type case of the converting-move-ctor.
      * `std::exchange` on `exec_` would be incorrect for self-move because of order of operations.
      * `std::exchange` on `call_` might be correct but it would be an extra template instantiation which is not desireable for `folly::Function`.
      
      Differential Revision: D33881266
      
      fbshipit-source-id: 5403b83498b9c1afa772564246eba4f112495761
      9adda7dd
    • Chad Austin's avatar
      limit parallelism based on available RAM · fa2f89f9
      Chad Austin authored
      Summary:
      A long time ago, getdeps scheduled each build up to the number of hardware threads. For some builds, that was too heavy, so it got throttled back to only ever use half the hardware threads. This left parallelism on the table for CPU-bound projects that don't use much RAM per compilation.
      
      This commit makes better use of the hardware with finer-grained logic that allows each manifest to specify a `job_weight_mib` estimate in MiB, and limit concurrency to `available_ram / job_weight`.
      
      Reviewed By: ahornby
      
      Differential Revision: D33754018
      
      fbshipit-source-id: 785bed6c6cfe3c473244e0806a77cec1fc119e1f
      fa2f89f9
  4. 01 Feb, 2022 5 commits
    • Yedidya Feldblum's avatar
      atomic_fetch_flip · aa68792c
      Yedidya Feldblum authored
      Summary:
      The flip operation, like the set and reset operations, are optimizable on x86-related architectures using the `btc` instruction, compared with `bts` and `btr` for set and reset operations.
      
      The optimization is done for gnu-like compilers. However, for MSVC, there is no interlocked intrinsic for `btc`, so the optimization is not done.
      
      Reviewed By: luciang
      
      Differential Revision: D32049844
      
      fbshipit-source-id: 5f60f8c4c534fb0ee41d76c5d766f96f7ff94892
      aa68792c
    • Chad Austin's avatar
      update to checkout@v2 · 49bf3d46
      Chad Austin authored
      Summary:
      checkout@v2 is the current action version, and the old one may have
      security issues. Let's just run with the latest version.
      
      Reviewed By: ahornby
      
      Differential Revision: D33834847
      
      fbshipit-source-id: fba0733577bf23c208c9824aa3815bd01a813d9a
      49bf3d46
    • Chad Austin's avatar
      update all github action workflows · 6a80f70a
      Chad Austin authored
      Summary:
      I'm about to upgrade from checkout v1 to checkout v2. First, update
      the GitHub action workflows for all projects.
      
      Reviewed By: ahornby
      
      Differential Revision: D33834784
      
      fbshipit-source-id: f4cba24f1a589588dbfaf7ad7ada7122dd8284cb
      6a80f70a
    • Xavier Deguillard's avatar
      eden: do not copy public_autocargo in internal builds · ea1dd511
      Xavier Deguillard authored
      Summary:
      The public_autocargo is for external builds, not internal ones as they contain
      references to git repository, while the non-public_autocargo refers to path in
      fbcode. In Sandcastle, git repositories can fail to be accessed due to lack fo
      proxies, thus we shouldn't access them.
      
      Reviewed By: kmancini
      
      Differential Revision: D33907864
      
      fbshipit-source-id: 3f2006607676cebd92201560365d179231214db4
      ea1dd511
    • Yedidya Feldblum's avatar
      bump googletest to 1.11.0 · 568f1c60
      Yedidya Feldblum authored
      Summary: Release notes are: https://github.com/google/googletest/releases/tag/release-1.11.0.
      
      Reviewed By: bigfootjon
      
      Differential Revision: D33868235
      
      fbshipit-source-id: 57b0e118d6ebadbaf634caccec50a0dd87f34fc8
      568f1c60
  5. 31 Jan, 2022 4 commits
    • Alex Hornby's avatar
      workaround for getdeps builds · 8d41a264
      Alex Hornby authored
      Summary: Workaround for getdeps builds of edenfs
      
      Reviewed By: fanzeyi
      
      Differential Revision: D33896917
      
      fbshipit-source-id: 9aed609ca6d5b209cda4fc7eecb52e5cfa9f6dac
      8d41a264
    • Alex Hornby's avatar
      move cargo logic to cargo.py · 8ff3267e
      Alex Hornby authored
      Summary:
      Move cargo logic to separate file as builder.py was getting a bit large
      
      It's just a move of source file for CargoBuilder.  Diff looks a bit big as I did hg cp to preserve history
      
      Differential Revision: D33888925
      
      fbshipit-source-id: 2d57343535ab087e09876edba4d00a6f0234fcd0
      8ff3267e
    • Michael Voznesensky's avatar
      Add empty IOBuf ctor to folly cython, to match IOBuf.h · 7725223a
      Michael Voznesensky authored
      Summary: Title
      
      Reviewed By: yfeldblum
      
      Differential Revision: D33873064
      
      fbshipit-source-id: 65b16ad30a7bf9f2b9e23857f072d33c94098899
      7725223a
    • Alex Hornby's avatar
      add autocargo for hgclientconf · 5da36fa6
      Alex Hornby authored
      Summary: Generate cargo files for hgclientconf
      
      Reviewed By: yancouto
      
      Differential Revision: D33843589
      
      fbshipit-source-id: d9b3452be684fcaa727c0c0a1175c1d8954bf9f2
      5da36fa6
  6. 29 Jan, 2022 6 commits
    • Yedidya Feldblum's avatar
      avoid append-va-arg in FOLLY_SAFE_CHECK · 53e82da0
      Yedidya Feldblum authored
      Summary:
      Since clang has a mode which rejects the append-va-arg construct as implemented in `FOLLY_PP_DETAIL_APPEND_VA_ARG`.
      
      Do this by avoiding appending va-args to other args. Instead, take advantage of `operator()` as a workaround.
      
      Avoids:
      ```
      folly/Preprocessor.h:72:46: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments]
      #define FOLLY_PP_DETAIL_APPEND_VA_ARG(...) , ##__VA_ARGS__
                                                   ^
      ```
      
      Reviewed By: luciang
      
      Differential Revision: D33863906
      
      fbshipit-source-id: 14912aca73e332ab811db4c0ac772a2d224a0666
      53e82da0
    • Yedidya Feldblum's avatar
      atomic-fetch-bit-op check functions · 84ff4e5f
      Yedidya Feldblum authored
      Summary: So that we may easily inspect the generated code.
      
      Reviewed By: ot, luciang
      
      Differential Revision: D32161049
      
      fbshipit-source-id: 00ca6f4196518389f7b1b18d9278085e1a3b43d2
      84ff4e5f
    • Yedidya Feldblum's avatar
      mark Function exec pointer as noexcept · 68b03455
      Yedidya Feldblum authored
      Summary:
      Function implements move and nuke operations via a type-erased pointer to an exec function. Both operations are explicitly noexcept but the function pointer which these operations call is not marked as noexcept. So the compiler emits unnecessary exception-handling code/data around the call. The exception-handling stuff make generated code larger and in theory may also hinder possible optimizations.
      
      But when the exec function pointer as marked as `noexcept`, the compiler may elide the exception-handling stuff, shrinking generated code and in theory permitting a class of optimizations.
      
      It is not possible for the underlying move operation to throw an exception since, if the move operation of the contained callable could throw an exception, the contained callable would be on-heap and not in-situ, and the underlying move operation would just be an infallible relocation of the in-situ `Function` state.
      
      It is possible for the underlying nuke operation to throw an exception since the destructor of the contained callable could throw an exception. But this is rare. In this case, the exec function would contain exception-handling stuff; but in general, it would not. And this would merely moves where the exception-handling stuff is for the nuke operation, from one side of the type-erasure to the other side.
      
      Reviewed By: ot, philippv, luciang
      
      Differential Revision: D32904616
      
      fbshipit-source-id: 5853a2d81a30bef565b350b72f5f35e6c9c9a45b
      68b03455
    • Yedidya Feldblum's avatar
      tweak symbolizer max-expected-frame-size for 32-bit · b1cf29bd
      Yedidya Feldblum authored
      Summary:
      Avoids:
      ```
      folly/experimental/symbolizer/StackTrace.cpp:192:15: error: the pointer incremented by 68719476736 refers past the last possible element for an array in 32-bit address space containing 64-bit (8-byte) elements (max possible 536870912 elements) [-Werror,-Warray-bounds]
                    normalStackFrame + kMaxExpectedStackFrameSize)) {
                    ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
      ```
      
      Reviewed By: kennyyu, luciang
      
      Differential Revision: D33837703
      
      fbshipit-source-id: 0ca6b7ba6c2f76d0be3c54c9784c305125b525df
      b1cf29bd
    • Yedidya Feldblum's avatar
      a benchmark program for atomic-fetch-bit-op · f4fa2a3f
      Yedidya Feldblum authored
      Summary: To measure `atomic_fetch_set` across sizes and behaviors.
      
      Reviewed By: luciang
      
      Differential Revision: D32262813
      
      fbshipit-source-id: 84510e85368cb5e012ddc8bbf2ca159444659f20
      f4fa2a3f
    • Max Katsev's avatar
      Add atomic_ref::exchange · 914047bd
      Max Katsev authored
      Reviewed By: ot
      
      Differential Revision: D33857528
      
      fbshipit-source-id: 265457c5771684d6830a16a3b7390e9bd99b277d
      914047bd
  7. 28 Jan, 2022 2 commits
    • Kenny Yu's avatar
      add symbolizer::getStackTrace to replace detail::getSingletonStackTrace · 2b99b21b
      Kenny Yu authored
      Summary:
      Currently, `getSingletonStackTrace` is in the logically private `detail`
      namespace. This adds `symbolizer::getStackTrace` to replace `detail::getSingletonStackTrace`,
      and this new location mirrors the existing `symbolizer::getAsyncStackTrace`.
      
      The changes will be done in multiple parts:
      - Add the new version
      - Modify all internal callers to use the new version
      - Delete the old version
      
      Reviewed By: yfeldblum
      
      Differential Revision: D33783972
      
      fbshipit-source-id: 137a1d654aea5a451bb90ca12e1916f91589b0df
      2b99b21b
    • Yedidya Feldblum's avatar
      FOLLY_SAFE_FATAL · c24b947e
      Yedidya Feldblum authored
      Summary: Like `FOLLY_SAFE_CHECK(true, ...)`.
      
      Reviewed By: luciang
      
      Differential Revision: D33801512
      
      fbshipit-source-id: c9023f4b14e0b045c654c15a8f2b9ea0cc384617
      c24b947e