1. 29 Apr, 2019 4 commits
  2. 28 Apr, 2019 1 commit
  3. 27 Apr, 2019 9 commits
    • Matthieu Martin's avatar
      Allow fibers Semaphore's Baton to signal during post · 0371d47f
      Matthieu Martin authored
      Summary:
      This change has no effect for normal use of the semaphore.
      
      With try_acquire (previous change), we now allow the callers to pass their own baton.
      It's possible that the caller ends up not needing to use the `post`, and simply wants to signal the semaphore. It's basically useful in scenario where the caller wants to wait for the first of multiple events.
      Current code would deadlock in this scenario, this fixes it.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D15090395
      
      fbshipit-source-id: 8e3d73705ef3559717b7335f6a9e9ea8bed1cb17
      0371d47f
    • Matthieu Martin's avatar
      Add try_acquire to folly::fibers::Semaphore · c379a920
      Matthieu Martin authored
      Summary: This provides an interface for the Semaphore, which allow async waiting for more complex usage on fiber, without the future overhead.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D15082111
      
      fbshipit-source-id: 76306525509f36867999db459ee0b7c42f416b6c
      c379a920
    • Nathan Bronson's avatar
      only run copyAfterRemovedCollisions test for SIMD F14 · beef6090
      Nathan Bronson authored
      Summary:
      This new test should have been inside the
      FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE conditional compilation guard.
      
      Reviewed By: mengz0
      
      Differential Revision: D15114483
      
      fbshipit-source-id: 2931be7d4abf7a4a95827052905bd219c9beff13
      beef6090
    • Andrii Grynenko's avatar
      Fix convertFuture · adfc1c67
      Andrii Grynenko authored
      Summary: It's unsafe to use Future after setCallback was called (its executor may be moved out), so we have to copy its executor before that.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15113490
      
      fbshipit-source-id: 2fa9c323ddfe1919b84bbfe05b6c5643d0c65703
      adfc1c67
    • Yedidya Feldblum's avatar
      Let RequestContext::setContext take by reference · 2d41ab6d
      Yedidya Feldblum authored
      Summary: [Folly] Let `RequestContext::setContext` and `RequestContextScopeGuard` members take `shared_ptr<RequestContex>` by reference. Saves a small amount on code size and runtime performance due to code size.
      
      Reviewed By: spalamarchuk
      
      Differential Revision: D15074704
      
      fbshipit-source-id: 20f1149b8c56d6c4375d63fe21560bdda5e5ccae
      2d41ab6d
    • Yedidya Feldblum's avatar
      Cut unused FutureBase::setContext_ overload · 16c1cb3b
      Yedidya Feldblum authored
      Summary: [Folly] Cut unused `FutureBase::setContext_` overload taking `shared_ptr<RequestContext>`.
      
      Reviewed By: mhorowitz
      
      Differential Revision: D15073509
      
      fbshipit-source-id: a8a9d37e3420168e63692ba77063452849355361
      16c1cb3b
    • Yedidya Feldblum's avatar
      Pass context by reference in the futures Core · caa3c6ee
      Yedidya Feldblum authored
      Summary: [Folly] Pass context by reference in the futures `Core`, saving on code size and a small on runtime performance due to code size.
      
      Reviewed By: Orvid
      
      Differential Revision: D15073282
      
      fbshipit-source-id: 7c55b9f6a55ee7ec22fde6f3ab9da232a8ee006b
      caa3c6ee
    • Yedidya Feldblum's avatar
      Move the context in futures Core::doCallback · dbac4430
      Yedidya Feldblum authored
      Summary: [Folly] Move the context in futures `Core::doCallback` to shrink code size and to improve runtime performance (fewer branches, fewer atomic RMWs, smaller code size).
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D15073122
      
      fbshipit-source-id: f1b5cb01ea9ccaa69ac5b42b01a8ee5fa1badb8a
      dbac4430
    • Yedidya Feldblum's avatar
      Cut explicit class template instantiations in futures · 7fcc5ddc
      Yedidya Feldblum authored
      Summary: [Folly] Cut explicit class template instantiations in futures. May save on code size when some of the given instantiations are not used, or when the given instantiations are used but when some of their members are not used.
      
      Reviewed By: LeeHowes
      
      Differential Revision: D15073879
      
      fbshipit-source-id: c624d7ea1dad66f05a9958239a87737367450753
      7fcc5ddc
  4. 26 Apr, 2019 3 commits
    • Nathan Bronson's avatar
      fix copy constructor in rare collision+erase case · 587e0c18
      Nathan Bronson authored
      Summary:
      F14NodeMap and F14ValueMap copy construction could fail to copy
      the chunk overflow count in a rare case where there is a suffix of chunks
      that suffers an overflow, then all of the non-overflowed keys are removed,
      then the map is copied. In the copy the remaining overflowed key isn't
      find()able, but it is still present on the iteration sequence. This diff
      fixes the problem.
      
      Reviewed By: WillerZ, shixiao
      
      Differential Revision: D15105104
      
      fbshipit-source-id: cff2073246bc301054996d4bb7e8baf9ee8c0021
      587e0c18
    • Lee Howes's avatar
      Remove member function pointer Future::then with keepalive · fe13e6a5
      Lee Howes authored
      Summary: As part of simplifying and removing ambiguity in the interface this removes the form of then(KeepAlive, member-function-pointer). Removing this directly removes the need to make multiple overloads, and migrating to a cleaner then(KeepAlive,...) form will delegate this to the application of the nested continuation.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15059814
      
      fbshipit-source-id: 8e4481cc471b4ed2dc578c52e26f2223c2468719
      fe13e6a5
    • Andrii Vasylevskyi's avatar
      Add getSecurityProtocol() to MockAsyncSocket · 7e63ae17
      Andrii Vasylevskyi authored
      Summary: Add getSecurityProtocol() to MockAsyncSocket
      
      Reviewed By: knekritz
      
      Differential Revision: D15099025
      
      fbshipit-source-id: 98b1337a9016e75eff11f37899180d323b67247c
      7e63ae17
  5. 25 Apr, 2019 8 commits
    • Cen Zhao's avatar
      add handshake events handling · d52f0f52
      Cen Zhao authored
      Summary: zmq4.3 bring up 4 more handshake events, add proper handling in sock monitor
      
      Reviewed By: saifhhasan
      
      Differential Revision: D15058676
      
      fbshipit-source-id: d2553c7e32471a2403857741cbb77a40e50d353e
      d52f0f52
    • Lewis Baker's avatar
      Add folly::coro::co_schedule · a5802280
      Lewis Baker authored
      Summary:
      Adds a utility that allows a coroutine to reschedule itself back onto its associated executor.
      
      This allows coroutines to cooperatively schedule themselves.
      
      It also allows a coroutine to force itself to be asynchronous by inserting a `co_await folly::coro::co_schedule;` as the first statement in the coroutine.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D15076362
      
      fbshipit-source-id: 4a4a2978519e0709d28a3e1aa8745ee30ddc7751
      a5802280
    • Joe Loser's avatar
      Replace boost::is_member_pointer with std::is_member_pointer (#1085) · ad5d6ff5
      Joe Loser authored
      Summary:
      :
      - Replace a call site in `DynamicParser-inl.h` using `boost::is_member_pointer`
        with the standard library equivalent.
      Pull Request resolved: https://github.com/facebook/folly/pull/1085
      
      Reviewed By: meyering
      
      Differential Revision: D14638847
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 8eb95607dc7134b9bbc6974052094a92623fe776
      ad5d6ff5
    • Joe Loser's avatar
      Cut FBSTRING_SANITIZE_ADDRESS in FBString.h (#1094) · 6e575a92
      Joe Loser authored
      Summary:
      - Defining `FBSTRING_SANITIZE_ADDRESS` is more complicated than it needs
        to be and it is in fact not even needed now.
      - Remove separate `FBSTRING_SANITIZE_ADDRESS` symbol and use
        `FOLLY_SANITIZE_ADDRESS` in places which previously used
        `FBSTRING_SANITIZE_ADDRESS`.
      Pull Request resolved: https://github.com/facebook/folly/pull/1094
      
      Reviewed By: Orvid
      
      Differential Revision: D14969931
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 7c1a585180ca99d1e2f616765aa77f45c4426fb8
      6e575a92
    • Victor Zverovich's avatar
      Migrate from Folly Format to fmt · 65cd9eff
      Victor Zverovich authored
      Summary: Migrate from Folly Format to fmt which provides smaller compile times and per-call binary code size.
      
      Reviewed By: alandau
      
      Differential Revision: D14954926
      
      fbshipit-source-id: 9d2c39e74a5d11e0f90c8ad0d71b79424c56747f
      65cd9eff
    • Nick Terrell's avatar
      Remove double dependencies · 53ef616d
      Nick Terrell authored
      Summary: Remove manual include overrides
      
      Reviewed By: k21
      
      Differential Revision: D15085229
      
      fbshipit-source-id: fbd3c66184a696131c61605eeb0bba119e59af9e
      53ef616d
    • Amir Livneh's avatar
      Fix typo · 7ac48326
      Amir Livneh authored
      Reviewed By: JunqiWang
      
      Differential Revision: D15073399
      
      fbshipit-source-id: 909fccfaa39da8f718b1195fa09ed2628f073c51
      7ac48326
    • Lee Howes's avatar
      Remove deprecation from then that simply forwards to thenTry. Deprecation was... · 05a81b12
      Lee Howes authored
      Remove deprecation from then that simply forwards to thenTry. Deprecation was inconsistent with defer.
      
      Summary: Future::then that forwards directly to thenTry is to be left for compatibility with Future::defer and to keep naming simple. This removes the confusing deprecation warning.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15057215
      
      fbshipit-source-id: 84103e47c958f1db602804f625591ba899e98b23
      05a81b12
  6. 24 Apr, 2019 7 commits
    • Lee Howes's avatar
      Remove =deleted deprecated Future APIs · 1b69c19e
      Lee Howes authored
      Summary: Functions were deprecated and =deleted to communicate their removal with a clear error rather than having the functions simply disappear. They have been in this state for long enough to cleanly remove them.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15057175
      
      fbshipit-source-id: fc9bb193e3cc9157ef6b898f0e4b7717581c1cdd
      1b69c19e
    • Jacob Lacouture's avatar
      avoid throwing in thenValue · 514a49f5
      Jacob Lacouture authored
      Summary:
      AFAIK, thenValue should effectively NOP if the future has an exception.
      Instead, it throws. C++ throw is expensive, as the stack_unwind process
      acquires a futex. If the service is seeing lots of exceptions (for example
      if it's overloaded and trying to shed load) throwing results in high lock
      contention.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13088019
      
      fbshipit-source-id: a4bd39d8196d8691ca3a2c21a4860024b366fdac
      514a49f5
    • Chad Austin's avatar
      fix warnings in Demangle.cpp · 3e8cb115
      Chad Austin authored
      Summary: Fix unused-argument warnings.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15068741
      
      fbshipit-source-id: 486451bd9bd8575bed8a647f4531783c82c079b5
      3e8cb115
    • Joe Loser's avatar
      Return reference in FBVector::emplace_back (#1114) · 5fc38975
      Joe Loser authored
      Summary:
      - Since C++17, `vector::emplace_back()` returns a reference to
        the new element inserted.
      - Differential Revision: D15007059 added support for these semantics in
        `small_vector`. This adds it for `FBVector` too to be symmetric.
      Pull Request resolved: https://github.com/facebook/folly/pull/1114
      
      Reviewed By: ot
      
      Differential Revision: D15053815
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 73ce9687e77ee9b97f12151cc148a84613b3ed1d
      5fc38975
    • Mohamed Bassem's avatar
      Add missing copyright headers · a79471ad
      Mohamed Bassem authored
      Reviewed By: AhmedSoliman
      
      Differential Revision: D15060131
      
      fbshipit-source-id: 428f50129ec79c0f6091829dc5946163e532cde1
      a79471ad
    • Nick Terrell's avatar
      Update to zstd-1.4.x · 64d6b0f5
      Nick Terrell authored
      Summary:
      * Update to zstd-1.4.x
      * Update to the latest zstd-rs
      
      Reviewed By: Cyan4973
      
      Differential Revision: D15040909
      
      fbshipit-source-id: 938904d95ab8b1108d750d83602ee9c11c2c87b5
      64d6b0f5
    • Lee Howes's avatar
      =delete Future::onError · b7e2f57b
      Lee Howes authored
      Summary:
      Replace Future::onError with Future::thenError:
       * to remove ambiguous typing
       * to ensure that the executor is not lost and the returned Future is still bound to an executor
      
      This diff finally removes the legacy onError.
      
      See:
      https://fb.workplace.com/groups/fbcode/permalink/2002251863144976/
      for details.
      
      Reviewed By: yfeldblum, Orvid
      
      Differential Revision: D15034702
      
      fbshipit-source-id: 17faf37e79c0a31ad25c02542f09a8293e693899
      b7e2f57b
  7. 23 Apr, 2019 2 commits
    • Lewis Baker's avatar
      Don't enable FOLLY_HAS_COROUTINES under MSVC or pre-C++17 · e9440ced
      Lewis Baker authored
      Summary:
      The folly::coro functionality depends heavily on the symmetric-transfer capability of coroutines which MSVC does not yet support.
      
      The folly/Portability.h header was previously defining FOLLY_HAS_COROUTINES to true for MSVC even though you would get compile errors if you tried to use any of the folly::coro facilities.
      
      Also further restrict defining FOLLY_HAS_COROUTINES only when C++17 or later is available as folly::coro makes use of C++17 language features.
      
      Reviewed By: yfeldblum, andriigrynenko
      
      Differential Revision: D14811921
      
      fbshipit-source-id: f3da2d3c07fc9ebe08f566a7707c62e74e412df9
      e9440ced
    • Victor Zverovich's avatar
      Remove unused legacy logging API · 8c0d65fe
      Victor Zverovich authored
      Summary:
      Remove legacy logging API (`XLOGC` and friends) because it is not used anywhere
      and is not fully safe being varargs-based. The code that needs to be converted
      from `printf`-based logging can use fmt's `printf` API which is fully type-safe.
      
      Reviewed By: simpkins
      
      Differential Revision: D15036094
      
      fbshipit-source-id: 3919e5d4eb7994ed0db4fa47bada111ab0dca505
      8c0d65fe
  8. 21 Apr, 2019 3 commits
    • Orvid King's avatar
      Attempt to migrate some things · 3beebd30
      Orvid King authored
      Summary: temp
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14882681
      
      fbshipit-source-id: 3017cb9743c81396764e6a61bdca183ae2692401
      3beebd30
    • Joe Loser's avatar
      Enable IntToDouble test in ConvTest (#1112) · 4ebfe3cf
      Joe Loser authored
      Summary:
      - Most of `IntToDouble` test is commented out as it previously did not
        work with GCC 4.6.1.
      - Enable the rest of this test as it works fine on GCC 5.1
      Pull Request resolved: https://github.com/facebook/folly/pull/1112
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15014999
      
      Pulled By: Orvid
      
      fbshipit-source-id: a26a0fcacc9a22c03d0d67c35cabf8ec0ca91813
      4ebfe3cf
    • Orvid King's avatar
      Fix MSVC builds · c47ff43b
      Orvid King authored
      Summary: The only fix in this diff to an error currently being seen by the contbuilds is the change to concurrent hash map. The rest would have been seen when building the slow tests is enabled.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14898822
      
      fbshipit-source-id: b28cd697496bb97b0e35b189a9bb31b666da3b17
      c47ff43b
  9. 19 Apr, 2019 3 commits
    • Joe Loser's avatar
      Simplify some macros testing __GNUC__ and __clang__ (#1095) · 6607a501
      Joe Loser authored
      Summary:
      - Both GCC and Clang define the macro `__GNUC__`, `__GNUG__` and
        friends. Simplify some macros whose intent is to check "if we are GCC or
        Clang" but do so via checking `__GNUC__` in addition to `__clang__`. It
        is sufficient to just check `__GNUC__`.
      Pull Request resolved: https://github.com/facebook/folly/pull/1095
      
      Reviewed By: Orvid
      
      Differential Revision: D14697480
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: cd6ec82c4235a1321ecdf240afaad7d5c0e99437
      6607a501
    • Yedidya Feldblum's avatar
      Consistent void return-type checks in DistributedMutex · 3291f635
      Yedidya Feldblum authored
      Summary: [Folly] Consistent `void` return-type checks in `DistributedMutex`. `const void` is a different type from `void`, but both match the `std::is_void` predicate.
      
      Reviewed By: aary
      
      Differential Revision: D14638815
      
      fbshipit-source-id: 96d1e18dfe1026b3881dafe5ceb816a8dd3add08
      3291f635
    • Giuseppe Ottaviano's avatar
      Return reference in small_vector::emplace_back · bbe656da
      Giuseppe Ottaviano authored
      Summary: Since C++17 `vector::emplace_back()` returns a reference to the new element, support that in `small_vector` too.
      
      Reviewed By: terrelln, luciang
      
      Differential Revision: D15007059
      
      fbshipit-source-id: 3873fd0097e3d50f7967f47fbecfa6ab20cc72c5
      bbe656da