1. 05 Jan, 2018 10 commits
    • Yedidya Feldblum's avatar
      Synchronized::exchange · 881088fc
      Yedidya Feldblum authored
      Summary:
      [Folly] `Synchronized::exchange`, for assigning a new value and returning the old value.
      
      (Note: this ignores all push blocking failures!)
      
      Differential Revision: D6653482
      
      fbshipit-source-id: 68f4bd330bc2cf37bb92aff98b8ce3221334112e
      881088fc
    • Yedidya Feldblum's avatar
      Fix copyright lines in folly/synchronization/Baton.h · 18b6a2dd
      Yedidya Feldblum authored
      Summary: [Folly] Fix copyright lines in `folly/synchronization/Baton.h`.
      
      Reviewed By: meyering
      
      Differential Revision: D6665595
      
      fbshipit-source-id: 84aa0c475f01c858d543a047103437c083b3a4ed
      18b6a2dd
    • Mingtao Yang's avatar
      Clarify folly::ssl::init documentation · 64c5a213
      Mingtao Yang authored
      Summary: Adds wording indicating that it is safe to call this function multiple times.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6625530
      
      fbshipit-source-id: 2305f7b8e3451a6663003d23230b22c6f65a3729
      64c5a213
    • Yedidya Feldblum's avatar
      Cut glog include from folly/synchronization/RWSpinLock.h · 5cb23840
      Yedidya Feldblum authored
      Summary: [Folly] Cut `glog` include from `folly/synchronization/RWSpinLock.h`.
      
      Reviewed By: meyering
      
      Differential Revision: D6659300
      
      fbshipit-source-id: 0f1b79d98be0656694f57667252a16acd54e2414
      5cb23840
    • Yedidya Feldblum's avatar
      Move folly/RWSpinLock.h to folly/synchronization/ · 5be3abd7
      Yedidya Feldblum authored
      Summary: [Folly] Move `folly/RWSpinLock.h` to `folly/synchronization/`.
      
      Reviewed By: elsteveogrande
      
      Differential Revision: D6659265
      
      fbshipit-source-id: 307723e22f42ceb104f26657aed8b34f7e183afb
      5be3abd7
    • Yedidya Feldblum's avatar
      Extract WaitOptions · 183fc6b4
      Yedidya Feldblum authored
      Summary:
      [Folly] Extract `WaitOptions` from `SaturatingSemaphore`.
      
      This type may prove useful in the future for a variety of similar cases, and so does not need to be locked up inside `SaturatingSemaphore`.
      
      Additionally:
      * Extract and redraft a comment from `Baton`.
      * Rename `pre_block` to `spin_max`.
      
      Reviewed By: djwatson, aary
      
      Differential Revision: D6632875
      
      fbshipit-source-id: 6b7faeeb6e1ac2011a037c2b560def0ee2e9f3d4
      183fc6b4
    • Yedidya Feldblum's avatar
      Move folly/BitIterator.h to folly/container/ · f6ed4a26
      Yedidya Feldblum authored
      Summary: [Folly] Move `folly/BitIterator.h` to `folly/container/`.
      
      Reviewed By: djwatson
      
      Differential Revision: D6648357
      
      fbshipit-source-id: 5617e3210f58435fcbf3ef07fa745da47dbce475
      f6ed4a26
    • Yedidya Feldblum's avatar
      Move InPlaceConstruction test in folly/test/SynchronizedTest.cpp · d41f4cc9
      Yedidya Feldblum authored
      Summary: [Folly] Move `InPlaceConstruction` test in `folly/test/SynchronizedTest.cpp`.
      
      Differential Revision: D6653481
      
      fbshipit-source-id: f0eadfd6c2f41e9f597a666d01e40d5553447c70
      d41f4cc9
    • Yedidya Feldblum's avatar
      Fix copyright lines for folly/Synchronized.h · 7ce61a15
      Yedidya Feldblum authored
      Summary: [Folly] Fix copyright lines for `folly/Synchronized.h`.
      
      Reviewed By: meyering
      
      Differential Revision: D6664326
      
      fbshipit-source-id: 71a0fc17358e41dfc751b8bcb0736c288975a4a0
      7ce61a15
    • Neel Goyal's avatar
      Add utility to create stores · 79c30edd
      Neel Goyal authored
      Summary: Add methods to create a X509StoreUniquePtr from a ca file or buffer.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6662538
      
      fbshipit-source-id: 646f61596f2787756b2fa5998a43f36d75a91d90
      79c30edd
  2. 04 Jan, 2018 1 commit
    • Keith Daigle's avatar
      Make FOLLY_HAS_COROUTINES dependent on header · c60784b8
      Keith Daigle authored
      Summary:
      This breaks while building on aarch64 each time because the headers aren't
      in the repo. I did a quick grep and I don't see anything in folly that
      uses OptionalAwaitable or OptionalPromise so perhaps it's possible to
      remove instead, can do that if preferred.  Depends on D6611609 to complete
      build of tests cleanly.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6643759
      
      fbshipit-source-id: f480d50383f85fbe905daaad74198b6557609347
      c60784b8
  3. 03 Jan, 2018 3 commits
    • Yedidya Feldblum's avatar
      Avoid allocs in dtors in futures collect · 92d510df
      Yedidya Feldblum authored
      Summary:
      [Folly] Avoid allocs in dtors in futures `collect`.
      
      `CollectContext`, a detail helper type, allocates storage for a results vector in its dtor. This is an awkward situation and should be avoided.
      
      Reviewed By: ericniebler
      
      Differential Revision: D6649299
      
      fbshipit-source-id: 87746fcc78fa080f63505d7bb864aca6c4a3d7cb
      92d510df
    • Keith Daigle's avatar
      Fix to build SharedMutexTest on aarch64 · eba5e7f2
      Keith Daigle authored
      Summary:
      While trying to build folly on aarch64 found that the SharedMutexTest
      wouldn't build because it uses RWTicketSpinLock which was only available
      on x86 platforms.  Updated to allow build on aarch64 after suggestion by Orvid
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6611609
      
      fbshipit-source-id: 8ec477cdedac0f0a705608bbac42dd63b3efb919
      eba5e7f2
    • Lee Howes's avatar
      Make consistent set of get and getTry methods on SemiFuture. · ff18deaf
      Lee Howes authored
      Summary: Complete set of get and getVia methods including addition of a result operation on FutureBase that provides functionality of the old getTry on Future by returning a Try by reference.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6640056
      
      fbshipit-source-id: 3ac01f7bc4b128e641f08d9a99280a18ffce82f9
      ff18deaf
  4. 02 Jan, 2018 5 commits
    • Yedidya Feldblum's avatar
      Remove SingletonVault C bindings · 661c75b6
      Yedidya Feldblum authored
      Summary: [Folly] Remove `SingletonVault` C bindings. They are not generally needed.
      
      Reviewed By: spalamarchuk
      
      Differential Revision: D6632104
      
      fbshipit-source-id: 3aecb35277bc76a2171487404d6994a5ea296afc
      661c75b6
    • Yedidya Feldblum's avatar
      Use member-invoke traits in LockTraits · 43523e0c
      Yedidya Feldblum authored
      Summary:
      [Folly] Use member-invoke traits in `LockTraits`.
      
      V.s. spelling out the SFINAE manually.
      
      Reviewed By: Orvid
      
      Differential Revision: D6637380
      
      fbshipit-source-id: 212e0cc5e54503b31e458b6bda93b2a3b24e6c59
      43523e0c
    • Yedidya Feldblum's avatar
      invoke and member-invoke tweaks · 1a50cb78
      Yedidya Feldblum authored
      Summary:
      [Folly] `invoke` and member-`invoke` tweaks.
      
      * Direct `static_cast` v.s. `std::forward` is okay.
      * Implement member-`invoke` in terms of `invoke` and extract most of it to a helper type, minimizing the code directly generated by the preprocessor.
      
      Reviewed By: spalamarchuk
      
      Differential Revision: D6644119
      
      fbshipit-source-id: e58a83d7ff2dd71b0377d864ef089c34e0239c8d
      1a50cb78
    • Yedidya Feldblum's avatar
      Add ColdClassTest.cpp to oss builds · 228c05ff
      Yedidya Feldblum authored
      Summary: [Folly] Add `ColdClassTest.cpp` to oss builds.
      
      Reviewed By: spalamarchuk
      
      Differential Revision: D6648831
      
      fbshipit-source-id: f8d8a727d63e4e8b83391db454de990027f1bad4
      228c05ff
    • Yedidya Feldblum's avatar
      Fix copyright lines for Bits.h and move BitsBenchmark.cpp · 337e3b8a
      Yedidya Feldblum authored
      Summary: [Folly] Fix copyright lines for `Bits.h` and move `BitsBenchmark.cpp`.
      
      Reviewed By: spalamarchuk
      
      Differential Revision: D6648828
      
      fbshipit-source-id: 5eed558ac2d47a1497d64173bc84a4ca27d79764
      337e3b8a
  5. 01 Jan, 2018 3 commits
    • Yedidya Feldblum's avatar
      Fix some copyright lines in folly/ · 454829ac
      Yedidya Feldblum authored
      Summary:
      [Folly] Fix some copyright lines in `folly/`.
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: Orvid
      
      Differential Revision: D6648215
      
      fbshipit-source-id: 6fc446028ff79aa44116424e86ad454077717f8e
      454829ac
    • Yedidya Feldblum's avatar
      Fix some copyright lines in folly/lang/ · 52a77c35
      Yedidya Feldblum authored
      Summary:
      [Folly] Fix some copyright lines in `folly/lang/`.
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: Orvid
      
      Differential Revision: D6648214
      
      fbshipit-source-id: fa2afdb8369252b74b914622ad39f7f27261d2c1
      52a77c35
    • Yedidya Feldblum's avatar
      Fix some copyright lines in folly/experimental/symbolizer/ · 52dc008c
      Yedidya Feldblum authored
      Summary:
      [Folly] Fix some copyright lines in `folly/experimental/symbolizer/`.
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: Orvid
      
      Differential Revision: D6648183
      
      fbshipit-source-id: 36f9df5af91400a37dfa5ee2b209ffd47d5069df
      52dc008c
  6. 31 Dec, 2017 2 commits
    • Yedidya Feldblum's avatar
      constexpr_pow · b2ae6ce3
      Yedidya Feldblum authored
      Summary:
      [Folly] `constexpr_pow`.
      
      The power function. Initially, supports nonnegative integers only.
      
      Reviewed By: spalamarchuk
      
      Differential Revision: D6646376
      
      fbshipit-source-id: 33a5a45f496b6f3be52d0cd7e3a5f2cd7edb3026
      b2ae6ce3
    • Yedidya Feldblum's avatar
      Give detail functions in ConstexprMath.h decorated names · 4753aa16
      Yedidya Feldblum authored
      Summary:
      [Folly] Give detail functions in `ConstexprMath.h` decorated names.
      
      So that other code also in `namespace folly::detail` which invokes the non-detail functions will result in ambiguity.
      
      Reviewed By: spalamarchuk
      
      Differential Revision: D6646313
      
      fbshipit-source-id: 679e4cfe1c90f494acacef8b2a38a453db4d79d5
      4753aa16
  7. 30 Dec, 2017 3 commits
  8. 28 Dec, 2017 3 commits
    • Aaryaman Sagar's avatar
      Added remove_cvref · e14ef532
      Aaryaman Sagar authored
      Summary:
      std::remove_cvref is like std::decay, but without the function to
      pointer and array to pointer decays
      
      Backport of http://en.cppreference.com/w/cpp/types/remove_cvref
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6639513
      
      fbshipit-source-id: 2a5e252678aacc09acf6ce4565872e7efb9b48f3
      e14ef532
    • Aaryaman Sagar's avatar
      folly::Indestructible interface improvement · 3c127a77
      Aaryaman Sagar authored
      Summary:
      As it stands the user cannot use initializer list constructors in the
      underlying type, this fixes that and provides a good interface change.
      This allows them to use list initialization, which works with initializer
      lists
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6620994
      
      fbshipit-source-id: c29199f97b434d84dd8d4cee2f00c5eccb316166
      3c127a77
    • Dave Watson's avatar
      synchronization/ParkingLot · 84ad2a4d
      Dave Watson authored
      Summary:
      A ParkingLot API inspired by linux futex syscall, and WebKit's parkingLot.
      
      Extends the futex interface with lambdas, such that many different sleeping abstractions
      can be built.
      
      Reviewed By: yfeldblum, aary
      
      Differential Revision: D6581826
      
      fbshipit-source-id: dba741fe4ed34f27bfad5f5747adce85741441e0
      84ad2a4d
  9. 27 Dec, 2017 6 commits
    • Lee Howes's avatar
      Add getVia and getTryVia to SemiFuture. · cadfe2cd
      Lee Howes authored
      Summary: Add getVia and getTryVia to SemiFuture to allow driving chains of work conveniently in the current thread.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6631898
      
      fbshipit-source-id: 324ef342a44d4ef502188b3cffde17103f0e6cb2
      cadfe2cd
    • Lee Howes's avatar
      Move getTry to subclasses. · 5b640629
      Lee Howes authored
      Summary:
      Move getTry from FutureBase to Future and SemiFuture.
      
      Make SemiFuture version move the result out for consistency with get.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6638561
      
      fbshipit-source-id: 551c0f06ed52ef6d8976a5971a5e90b3ab793da0
      5b640629
    • Lee Howes's avatar
      Add continuation to semifuture return test. · d0da61c2
      Lee Howes authored
      Summary: Add more detail to testing return of SemiFuture from a continuation to ensure correct behaviour.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6637565
      
      fbshipit-source-id: 096a7ca140e6bdef7baab6725e86d25cf79742d8
      d0da61c2
    • Lee Howes's avatar
      Add deprecation comments to folly::makeFuture. · 7acba7e1
      Lee Howes authored
      Summary:
      To ensure that we do not end up with continuable futures without attached executors we should deprecate folly::makeFuture. In most cases folly::makeSemiFuture is adequate here.
      
      This diff only adds comments to dissuade future use.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6628800
      
      fbshipit-source-id: c2b91df351cc5980c1bfb752f7536d320ef8168a
      7acba7e1
    • Lee Howes's avatar
      Add getSemiFuture to folly::SharedPromise · a5b53283
      Lee Howes authored
      Summary: Adds getSemiFuture functionality to folly::SharedPromise. Implements getFuture in terms of this, using folly::InlineExecutor to ensure that there is no change of behaviour.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6628723
      
      fbshipit-source-id: 0ce7c7773b9290998ce87f84fa5d82ba957f0313
      a5b53283
    • Yedidya Feldblum's avatar
      Namespacing and comments in folly/Likely.h · db0ea224
      Yedidya Feldblum authored
      Summary:
      [Folly] Namespacing and comments in `folly/Likely.h`.
      
      This adds `FOLLY_LIKELY` and `FOLLY_UNLIKELY`.
      
      Reviewed By: Orvid
      
      Differential Revision: D6636136
      
      fbshipit-source-id: da93220201cabca91b4477ab98269a0febb735db
      db0ea224
  10. 26 Dec, 2017 4 commits
    • Yedidya Feldblum's avatar
      Tweaks to AtomicStruct · af28f118
      Yedidya Feldblum authored
      Summary: [Folly] Tweaks to `AtomicStruct`.
      
      Reviewed By: Orvid
      
      Differential Revision: D6636432
      
      fbshipit-source-id: 274c118a732287219c569d7d3f4e170f275518f1
      af28f118
    • Lee Howes's avatar
      Ensure that returning a semifuture from a continuation works correctly. · fb2a27a3
      Lee Howes authored
      Summary: Returning a SemiFuture from a continuation should work by correctly checking the types and returning a folly::Future on the same executor as the original future that .then was applied to.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6597273
      
      fbshipit-source-id: cf2016a344d4b29f1d31c1da20c89df5b4cfe64e
      fb2a27a3
    • Yedidya Feldblum's avatar
      Remove folly/detail/UncaughtExceptionCounter.h · d0956208
      Yedidya Feldblum authored
      Summary:
      [Folly] Remove `folly/detail/UncaughtExceptionCounter.h`.
      
      It's a thin and unnecessary shell around `folly/UncaughtExceptions.h`.
      
      Reviewed By: Orvid
      
      Differential Revision: D6636260
      
      fbshipit-source-id: cdf6fa5fefc9fd69586c1c4c1a8443c5e8543b1c
      d0956208
    • Yedidya Feldblum's avatar
      constexpr_log2_ceil · 3b8919b3
      Yedidya Feldblum authored
      Summary: [Folly] `constexpr_log2_ceil`, like `constexpr_log2` but rounding up.
      
      Reviewed By: Orvid
      
      Differential Revision: D6636433
      
      fbshipit-source-id: a10f031cc9c91cfeba7b74bbf143895a311ca772
      3b8919b3