1. 12 Feb, 2022 3 commits
    • Yedidya Feldblum's avatar
      Function uninit-call should use terminate_with · 002c6020
      Yedidya Feldblum authored
      Summary: When the Function signature is `noexcept`, rather than using `throw_exception`, in order to save a bit of generated code size.
      
      Reviewed By: luciang
      
      Differential Revision: D34190570
      
      fbshipit-source-id: c0f9cbd6abffd9b1517d28126d8eb5c491089ea8
      002c6020
    • Yedidya Feldblum's avatar
      patch AtFork test under TSAN · 70487d25
      Yedidya Feldblum authored
      Summary: TSAN detects and reports leaked threads in the child process, and exits nonzero. The parent process checks for zero exit code. Permit the TSAN exit code as well under TSAN.
      
      Differential Revision: D34191672
      
      fbshipit-source-id: 359fe91e617d962af2705896c392001bdd458d7b
      70487d25
    • Yedidya Feldblum's avatar
      forbid overriding sfinae in Function · ec16b8a7
      Yedidya Feldblum authored
      Summary: By using a clever trick which "absorbs" attempts to force types for what should be subject to sfinae.
      
      Reviewed By: luciang
      
      Differential Revision: D34160080
      
      fbshipit-source-id: a370c0240088cc78b8760e9f5736c3224842ae04
      ec16b8a7
  2. 11 Feb, 2022 4 commits
  3. 10 Feb, 2022 7 commits
    • Denis Dydychkin's avatar
      Temporarily disabling ConcurrentHashMapTest.ConcurrentInsertClear · 744a0a69
      Denis Dydychkin authored
      Summary: ConcurrentHashMapTest.ConcurrentInsertClear is reported as flaky, see T111753832, T111745080, etc. Temporarily disabling the test while investigating the root cause. Preliminary observation is that folly::CPUThreadPoolExecutor/(anonymous namespace)::HazptrTPETag doesn't shutdown cleanly. Happens both to SIMD and regular version
      
      Reviewed By: magedm
      
      Differential Revision: D34147319
      
      fbshipit-source-id: 8a9d9c71c4a42544df93fc48a324bd1299395719
      744a0a69
    • Ajanthan Asogamoorthy's avatar
      Implement getEkm · 7046027a
      Ajanthan Asogamoorthy authored
      Summary: As title says, in this case implement just means call into openssl's implementation
      
      Reviewed By: mingtaoy
      
      Differential Revision: D33828545
      
      fbshipit-source-id: 638adba4dd87dbccbc3886a512c52b5b8d44b5da
      7046027a
    • Ajanthan Asogamoorthy's avatar
      Add getEkm · c17c984d
      Ajanthan Asogamoorthy authored
      Summary: To generically get the exported keying material from our transports. As the code comments say this is intended to be used to bind data to the stream/connection itself.
      
      Reviewed By: yfeldblum, knekritz
      
      Differential Revision: D33828649
      
      fbshipit-source-id: c046eccfad5fc34188a310409ceb6c84d42e9f79
      c17c984d
    • Chad Austin's avatar
      fix 'error: Microsoft Visual C++ 14.0 is required' red herring on GitHub Actions (#998) · d3535fc2
      Chad Austin authored
      Summary:
      Pull Request resolved: https://github.com/facebook/watchman/pull/998
      
      A detailed description of this change is included in the new comment.
      
      Reviewed By: fanzeyi
      
      Differential Revision: D34124030
      
      fbshipit-source-id: f37c458bae135357e16b256e09f0d6eb8f1f996d
      d3535fc2
    • Chad Austin's avatar
      update all Windows jobs to windows-2019 (#1714) · 6b9d840a
      Chad Austin authored
      Summary:
      Pull Request resolved: https://github.com/facebook/folly/pull/1714
      
      windows-2016 will be removed in March, and now that we've updated
      Boost, we can upgrade to windows-2019.
      
      Reviewed By: genevievehelsel
      
      Differential Revision: D34119171
      
      fbshipit-source-id: caad432bebf6b8282844bf79f82b1fbc34f2df9e
      6b9d840a
    • Denis Dydychkin's avatar
      ConcurrentHashMap: Fix race condition in clear() · 39e19a49
      Denis Dydychkin authored
      Summary: ConcurrentHashMap's clear() implementation had a race condition where bucket_count_ / chunk_count_ might be changed after they are read, resulting in smaller than required replacement buffer being created. This change addresses race condition and adds test to reproduce the issue.
      
      Reviewed By: magedm
      
      Differential Revision: D34022761
      
      fbshipit-source-id: 1c8e8c382adf3839cbb4031e85314a02d963a762
      39e19a49
    • Yedidya Feldblum's avatar
      cut unused helper traits from Function · ad51d2b1
      Yedidya Feldblum authored
      Reviewed By: ot, luciang
      
      Differential Revision: D32974082
      
      fbshipit-source-id: b5bc35a56ef7600790938a73af586154b1631903
      ad51d2b1
  4. 09 Feb, 2022 10 commits
    • Alex Hornby's avatar
      remove generated thrift code and fix external CI (#26) · 7090d2e1
      Alex Hornby authored
      Summary:
      Pull Request resolved: https://github.com/facebookexperimental/rust-shed/pull/26
      
      Pull Request resolved: https://github.com/facebookexperimental/eden/pull/104
      
      No need for the checked in generated code anymore
      
      Successful external CI Linux run on Git Hub PR: https://github.com/facebookexperimental/eden/runs/5130405984?check_suite_focus=true
      
      Mac PR run fails with a SSL cert issue, will look separately
      
      Reviewed By: chadaustin, mitrandir77
      
      Differential Revision: D33840545
      
      fbshipit-source-id: eafc2a0e2191d438fd828adeebc2e318d319025f
      7090d2e1
    • Joseph Hwang's avatar
      Support arbitrary timepoint granularity QuantileEstimations · c9e8eb42
      Joseph Hwang authored
      Summary: This change should not make a functional difference to any existing callers. The underlying data structure stores a TimePoint.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D34060591
      
      fbshipit-source-id: b2b4d7f0d7fed8220cffb6b1dba5082d21073686
      c9e8eb42
    • Dead Code Bot's avatar
      Remove dead includes in folly/python · 9ee77a54
      Dead Code Bot authored
      Reviewed By: pranavtbhat
      
      Differential Revision: D34103812
      
      fbshipit-source-id: e02b728d468bf091e8b4521f8f8746a986a2130d
      9ee77a54
    • Kurt Tomlinson's avatar
      Move at least one virtual method to our cpp files · 48088b6d
      Kurt Tomlinson authored
      Summary: Define at least one virtual method in a cpp file.
      
      Differential Revision: D33891879
      
      fbshipit-source-id: 3d2e3177b112c5fc7b2b84ed8bc41c5d0e15127e
      48088b6d
    • Philip Pronin's avatar
      expose multi-add in SoftRealTimeExecutor · aa0ba075
      Philip Pronin authored
      Summary:
      `EDFThreadPoolExecutor` is currently the only implementation of
      `SoftRealTimeExecutor`, and it implements multi-add functionality (which
      allows us to wake up idle threads just once on batch-add, as well as reduces
      planning overhead), let's expose this at an interface level.
      
      Reviewed By: ot, luciang
      
      Differential Revision: D34095644
      
      fbshipit-source-id: ba59300a4c51599d7c6cbfaaabe3d6013be7c37f
      aa0ba075
    • Chad Austin's avatar
      fix Watchman build on FreeBSD · d14c1d91
      Chad Austin authored
      Summary:
      Watchman advertises support for FreeBSD but it's regressed a couple
      ways. Ensure it builds on FreeBSD again with a Vagrantfile.
      
      Reviewed By: ahornby
      
      Differential Revision: D33989289
      
      fbshipit-source-id: ff906bc219974bafbc349740ce6bddfe5bd2908f
      d14c1d91
    • Chad Austin's avatar
      add freebsd support · e3cad933
      Chad Austin authored
      Summary: Add some basic support for FreeBSD to getdeps.
      
      Reviewed By: ahornby
      
      Differential Revision: D33989129
      
      fbshipit-source-id: 42ff5f160b7e19c12196bb2e52a726f7815487bd
      e3cad933
    • Chad Austin's avatar
      fix WindowTest on Windows · 041a50c9
      Chad Austin authored
      Summary: `unsigned long` and `size_t` are not the same type on Clang Windows.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D34086667
      
      fbshipit-source-id: adba5d960cb4c8b8e13b62f419d5b4179b1525e1
      041a50c9
    • Xavier Deguillard's avatar
      eden: do not copy hg-server in shipit · f4cb3709
      Xavier Deguillard authored
      Summary:
      This is an old copy of Mercurial, saved to keep the Mercurial servers running
      until we completely pull the plug on them. Neither EdenFS nor EdenSCM should
      depend on it.
      
      Reviewed By: mitrandir77
      
      Differential Revision: D34081890
      
      fbshipit-source-id: 78e2c07fae75b3f25aa492ece03308f736d42769
      f4cb3709
    • Yedidya Feldblum's avatar
      simplify Function is-small check · 209cc2f8
      Yedidya Feldblum authored
      Summary:
      In a way which also happens to improve build speed.
      
      It turns out that the bulk of the improvement comes from removing the use of `std::is_nothrow_move_constructible` since it may internally have a `std::declval` in there. But that's not the only source of improvements.
      
      ```name=trunk
      $ foundation/scripts/run-perf-compile --syntax folly/futures/test/FutureTest.cpp
           8,367,373,932      instructions:uP
      ```
      ```name=branch
      $ foundation/scripts/run-perf-compile --syntax folly/futures/test/FutureTest.cpp
           8,101,850,897      instructions:uP
      ```
      
      Reviewed By: luciang
      
      Differential Revision: D32973629
      
      fbshipit-source-id: 37c27763a4f622750719db11fee7cb23c0b0291e
      209cc2f8
  5. 08 Feb, 2022 10 commits
    • Chad Austin's avatar
      upgrade libevent to 2.1.12 · ed9a4edd
      Chad Austin authored
      Summary:
      libevent 2.1.8 is not aware of the arc4random deprecation on FreeBSD,
      so upgrade to the latest.
      
      Reviewed By: xavierd
      
      Differential Revision: D33984680
      
      fbshipit-source-id: b7d2b869bc47d49d8f29df1b318d8f2067204aae
      ed9a4edd
    • Dan Melnic's avatar
      Adding AsyncSSLSocket::performReadv support · 39f73024
      Dan Melnic authored
      Summary: Adding AsyncSSLSocket::performReadv
      
      Reviewed By: afrind
      
      Differential Revision: D33717297
      
      fbshipit-source-id: 413f50fcaf1d59cec98765a095a5a5964f634e23
      39f73024
    • Chad Austin's avatar
      fix windows builds · 62fb14dc
      Chad Austin authored
      Summary:
      The new boost has an MSVC detection algorithm that 1) I don't
      understand and 2) does not even seem deterministic. Since our internal
      builds are pinned to vc142, force that in the manifest.
      
      Reviewed By: fanzeyi
      
      Differential Revision: D34085081
      
      fbshipit-source-id: d8ce4d8e28aad14f6fa60f9227dafb546ce321e5
      62fb14dc
    • Alex Hornby's avatar
      move autocargo up one level (#101) · 3a360d04
      Alex Hornby authored
      Summary:
      Pull Request resolved: https://github.com/facebookexperimental/eden/pull/101
      
      public_autocargo already existed for edenfs, but needed to move up a level so to make edenfs thrift definition visible via autocargo.
      
      Reviewed By: markbt
      
      Differential Revision: D32693522
      
      fbshipit-source-id: 4c070cfa2d6294a28c17697338f0309dcab1576f
      3a360d04
    • Alex Hornby's avatar
      generate the eden_scm github actions (#103) · f57a1427
      Alex Hornby authored
      Summary:
      Pull Request resolved: https://github.com/facebookexperimental/eden/pull/103
      
      Automate maintenance of the edenscm_* github actions yamls
      
      Add job file and name options and support for the Rust install section
      
      Reviewed By: fanzeyi
      
      Differential Revision: D34044422
      
      fbshipit-source-id: 7d5f07d37bab1eff5de30a88e710dbf7479ca192
      f57a1427
    • Alex Hornby's avatar
      regenerate github actions · 713c9b5e
      Alex Hornby authored
      Summary: Fix the getdeps.py  generation sub command and regenerate github actions before making changes to support actions generation for eden_scm
      
      Reviewed By: fanzeyi
      
      Differential Revision: D34044243
      
      fbshipit-source-id: 0039d04f25af4c842145dc142dae6b9996fc8046
      713c9b5e
    • Yedidya Feldblum's avatar
      revise Indestructible to elide dtors · 1c6d910c
      Yedidya Feldblum authored
      Summary:
      For global variables with nontrivial destructors, the compiler inserts calls to `atexit` to destroy the variables at shutdown time. For global variables with trivial destructors, the compiler elides such calls. Revise `Indestructible` to have a trivial destructor.
      
      Some compilers optimize further and remove such calls even for some nontrivial destructors, but not all do so.
      
      Also remove move-construction and move-assignment. And remove actual `constexpr`-constructibility since `::new` is not a constant expression.
      
      Reviewed By: chadaustin
      
      Differential Revision: D34026842
      
      fbshipit-source-id: 9ab2f957cbe9a67809a6c99e6b9370c1f4315777
      1c6d910c
    • Yedidya Feldblum's avatar
      let FOLLY_SAFE_CHECK macro-stringize the expression only once · 2b4fe254
      Yedidya Feldblum authored
      Reviewed By: ot, luciang
      
      Differential Revision: D33864764
      
      fbshipit-source-id: 9839f578bd0fe5e8f69d5299287a59cb471f8cf3
      2b4fe254
    • Yedidya Feldblum's avatar
      register_pass_v and usage in Function · 72c2e98e
      Yedidya Feldblum authored
      Summary: Whether a value is passed in registers also depends on its size, not just whether it is trivially copyable. (It also depends on its position in the arg-list but that is another step in complexity.)
      
      Reviewed By: luciang
      
      Differential Revision: D33079529
      
      fbshipit-source-id: ae7383d61491001e54892cf077e45556801bdcf4
      72c2e98e
    • Yedidya Feldblum's avatar
      avoid implicit conversions in Bits · fe4dbb77
      Yedidya Feldblum authored
      Differential Revision: D34056336
      
      fbshipit-source-id: adf4c0b96d6fd3f5e15c7bfefe7e908e85baf5b1
      fe4dbb77
  6. 07 Feb, 2022 2 commits
    • Yedidya Feldblum's avatar
      avoid excessive instantiations of std::declval in Function · c1b3be25
      Yedidya Feldblum authored
      Summary:
      It turns out that instantiating this function declaration template so widely measurably affects build speed. Prefer alternative techniques, such as `FOLLY_DECLVAL`.
      
      ```name=trunk
      $ foundation/scripts/run-perf-compile --syntax folly/futures/test/FutureTest.cpp
           8,462,001,355      instructions:uP
      ```
      ```name=branch
      $ foundation/scripts/run-perf-compile --syntax folly/futures/test/FutureTest.cpp
           8,362,569,934      instructions:uP
      ```
      
      Reviewed By: Gownta, luciang
      
      Differential Revision: D32973365
      
      fbshipit-source-id: 6930f75e04e0bb9ac4216b08645e67b98ca2c2f3
      c1b3be25
    • Yedidya Feldblum's avatar
      condense the atomic-fetch-bit-op implementations · d60894bf
      Yedidya Feldblum authored
      Summary: Coalesce the inline-asm. Use invokers.
      
      Reviewed By: Gownta
      
      Differential Revision: D32302511
      
      fbshipit-source-id: 6edf75c6ef820ed80e751d965174e5acfaac957e
      d60894bf
  7. 06 Feb, 2022 4 commits
    • Zino Benaissa's avatar
      heap_vector_map, heap_vector_set · 80c05933
      Zino Benaissa authored
      Summary:
      Define `heap_vector_map` and `heap_vector_set`. These feature a fast lookup (find operation) which does not rely on `std::lower_bound` or similar to find keys. Map elements are not laid out in sorted order. Instead, they are laid out in heap order, which is also known as Eytzinger order. A heap order layout is optimal to maximize memory and cache locality of lookup operations.
      
      A heap vector set containing the elements 0-7 lays out the elements as:
      
                                           elements  in sorted order
        heap_container[0]  =  4 <-- middle
        heap_container[1]  =  2
        heap_container[2]  =  6
        heap_container[3]  =  1
        heap_container[4]  =  3
        heap_container[5]  =  5
        heap_container[6]  =  7 <-- max
        heap_container[7]  =  0 <-- min
      
      `heap_vector_map` (referred below as HM) is almost a drop-in replacements for `sorted_vector_map` (referred as SM). All SM APIs are supported, and are semantically equal, with very few exceptions.
      
      Although HM works correctly for any key value SM supports, the speedup of find operation (random key search) is typically limited to maps with small key types with comparison operations subject to inlining. Measurements suggest up to 2x speedup of find operation for HM compared to SM.
      
      The key tradeoff is that HM has slower insertion and removal operations and slower iteration. Prefer HM if updates and traversals operations are rare, and lookups are the dominant operation. Of course, SM itself has slow insertion and removal operations so, if these operations are sufficiently common, another map type entirely would be preferable.
      
      Key similarities:
      
      1) They have the same in-situ sizes: `sizeof(HM) == sizeof(SM)`.
      2) Insertions and removals. As expected, these operations are slower for HM. Both SM and HM need to move elements while preserving sorted or heap order but the SM operation can be much simpler.
      3) A fast construction of HM from a sorted vector or from a SM.
      4) An iterator that follows sorted order compatible with SM. This is complex, though. When sorted iteration order is not required, it is faster to use the enclosed container's iteration order.
      
      Key differences:
      
      1) iterate() is a new API that provides the iterator range of the container vector. iterate() enables the fastest traversal of the heap container elements. For example,
                for (auto& element : HS.iterator()) { // traversed as laid out in memory
                    std::cout << e << ", ";
                 }
      for above examples, the loop prints:  4, 2, 6, 1, 3, 5, 7, 0,
                 for (auto& element : HS) { // key-sorted
                    std::cout << e << ", ";
                 }
      for above examples, the loop prints:   0, 1, 2, 3, 4, 5, 6, 7,
      
      2) data() is purposely not provided because it does not point to the first elements. If the start address is needed, use instead HM.iterate().data()
      
      Reviewed By: Gownta
      
      Differential Revision: D32128733
      
      fbshipit-source-id: 1df7372720b969ee7a84004ded101db132e0c224
      80c05933
    • Yedidya Feldblum's avatar
      avoid Function instantiating std::decay over lambdas · c5d1dc7b
      Yedidya Feldblum authored
      Summary:
      It turns out that `std::decay` becomes expensive when as widely instantiated as it is.
      
      ```name=trunk
      $ foundation/scripts/run-perf-compile --syntax folly/futures/test/FutureTest.cpp
           6,336,421,499      instructions:uP
      ```
      
      ```name=branch
      $ foundation/scripts/run-perf-compile --syntax folly/futures/test/FutureTest.cpp
           6,287,269,480      instructions:uP
      ```
      
      Reviewed By: Gownta, luciang
      
      Differential Revision: D32973204
      
      fbshipit-source-id: 75d52fd5ced58f50518913d3c00709bcee27c87b
      c5d1dc7b
    • Yedidya Feldblum's avatar
      fix fbcode-builder build with googletest-1.11 · 4da17f04
      Yedidya Feldblum authored
      Reviewed By: ahornby
      
      Differential Revision: D34030118
      
      fbshipit-source-id: 2229527eebb147a9c2eea90be78ab72e63e2fe3f
      4da17f04
    • Alex Hornby's avatar
      declare the libsodium dependency · bc9cc4b3
      Alex Hornby authored
      Summary: Folly has an optional libsodium dependency.  Declare that in folly getdeps manifest so that the relevant code is built and tested in CI.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D34028478
      
      fbshipit-source-id: 5e7c2f86602b94a3a975907adf8bd04f49ec33c0
      bc9cc4b3