1. 16 Apr, 2019 4 commits
    • Kirk Shoop's avatar
      shift the property forward decls to forward.h · 366747df
      Kirk Shoop authored
      Summary: reduces folly::Executor dependencies
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14939208
      
      fbshipit-source-id: bc354e838608eb8b25373ed5179e72acef813edd
      366747df
    • Kirk Shoop's avatar
      remove _v that are not yet supported · 6128f71c
      Kirk Shoop authored
      Summary:
      fixed some compile errors when building SMC with pushmi as a dependency
      
      some _v traits do not exist
      
      a specialization of ManualLifetime<void> was required
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14939161
      
      fbshipit-source-id: 76a1f05d7ce889d00fdf4a264e5e719fdb12d4ac
      6128f71c
    • Vitalii Kalinkin's avatar
      Removed unused type alias · 8e706ec6
      Vitalii Kalinkin authored
      Summary: `reference_type` is unused
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14944273
      
      fbshipit-source-id: f4c968735fcb7173e5ee256381455c81492e02df
      8e706ec6
    • Nick Terrell's avatar
      zstd-1.4.0 compatibility · 39afdc0b
      Nick Terrell authored
      Summary:
      In zstd-1.4.0 we've renamed one function used by folly. Add compatibility
      macros to work with both function names.
      
      Reviewed By: Cyan4973
      
      Differential Revision: D14941863
      
      fbshipit-source-id: deaf63b28ac8e4c3e6f6c0c192ed2d0e452ddca7
      39afdc0b
  2. 15 Apr, 2019 7 commits
    • Cornel Rat's avatar
      Remove recursion from TimedMutex to avoid fiber stack overflows · 10d27fea
      Cornel Rat authored
      Summary: Under heavy contention, lock will recurse several times. This can lead to fiber stack overflow.
      
      Differential Revision: D14936384
      
      fbshipit-source-id: e934569a9f742859655ba3ea888ebabd4d959651
      10d27fea
    • Krishna Kondaka's avatar
      Support for capturing metadata while doing folly json parsing · 231d1cff
      Krishna Kondaka authored
      Summary: Support for capturing metadata while doing folly json parsing
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13626597
      
      fbshipit-source-id: 8e7a26e23d966240d35c4f6d6104d9334a675a12
      231d1cff
    • Dan Melnic's avatar
      Let ThreadLocalPtr reset() synchronize with Accessor · a4ece81e
      Dan Melnic authored
      Summary: Let `ThreadLocalPtr` member `reset()` synchronize with member type `Accessor` lifetime, preventing data races that could happen if `reset()` is called while another thread is within the `Accessor` critical section.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14878801
      
      fbshipit-source-id: 4090c5749d08bee3fd9b50b23df6e716bc78c9c7
      a4ece81e
    • Kirk Shoop's avatar
      add flow support to on() · 6eb8dace
      Kirk Shoop authored
      Summary: add support for flow to `on()` - requested by Songqiao
      
      Reviewed By: ericniebler
      
      Differential Revision: D14814588
      
      fbshipit-source-id: 3989d0aa554a32482dcc15c1ba706d5604c95eb8
      6eb8dace
    • Kirk Shoop's avatar
      make transform work with move-only functions · 2d2aabcd
      Kirk Shoop authored
      Summary: Fixes bug in transform reported by rhodo
      
      Reviewed By: ericniebler
      
      Differential Revision: D14814574
      
      fbshipit-source-id: fdc3866ad56ced11e858869a24ca95b08295477d
      2d2aabcd
    • Doron Roberts-Kedes's avatar
      folly: Alias ConcurrentHashMapSIMD to use SIMDTable backend · 4ee0d411
      Doron Roberts-Kedes authored
      Summary: The Impl param is last so its a pain to switch between BucketTable and SIMDTable in the common case where only KeyType and ValueType are specified. This diff enables ConcurrentHashMapSIMD<key, value>.
      
      Reviewed By: djwatson
      
      Differential Revision: D14916671
      
      fbshipit-source-id: 980518179b87316ae344cbf96be4e6bcc032424e
      4ee0d411
    • Victor Zverovich's avatar
      Add fmt to Folly's open-source dependencies · 8a695b8f
      Victor Zverovich authored
      Reviewed By: yfeldblum
      
      Differential Revision: D14813810
      
      fbshipit-source-id: b6294f0b2e52bd062ad7b1d5977fbe68dec82d1b
      8a695b8f
  3. 14 Apr, 2019 1 commit
  4. 12 Apr, 2019 6 commits
    • Nick Terrell's avatar
      Fix UB in small_vector · 22b69cc8
      Nick Terrell authored
      Summary:
      `moveObjectsRightAndCreate()` did pointer arithmetic outside of the object,
      because it had a one before the beginning pointer. Instead, decrement the
      pointers before use.
      
      Reviewed By: ot
      
      Differential Revision: D14887926
      
      fbshipit-source-id: 198151d1eaef17e86cda800367480e0a8f7b2f49
      22b69cc8
    • Nick Terrell's avatar
      Fix small_vector insert for non-default constructible types · 21c6ab58
      Nick Terrell authored
      Summary:
      Instead of default constructing in `moveObjectsRight`, insert the objects
      directly into the hole. This has the added benefit of avoid a default
      construction. The creation function has to be careful to return references
      (rvalue, or lvalue) to avoid extra constructions without guaranteed NRVO.
      
      I've constructed the elements in reverse order since it is strange to copy
      backwards, then construct forwards, but don't have strong opinions, since
      either way is correct.
      
      Reviewed By: ot
      
      Differential Revision: D14883034
      
      fbshipit-source-id: bc0d19bf94705718500b80e2d6c202784134e7a5
      21c6ab58
    • Jorge Lopez Silva's avatar
      Add shim for void X509_STORE_CTX_set0_verified_chain. · 1f180ff8
      Jorge Lopez Silva authored
      Summary:
      In order to set the verified chain of a X509 store we need to be able to use X509_STORE_CTX_set0_verified_chain both for openssl 1.1.0 and previous versions.
      
      Proxygen needs this to complete the clang/platform007 upgrade.
      
      Reviewed By: Orvid
      
      Differential Revision: D14894384
      
      fbshipit-source-id: 378eb834b077469b666ad303f28f54af5caff990
      1f180ff8
    • Sean Purcell's avatar
      Add folly::hasher for empty tuples · c1527c03
      Sean Purcell authored
      Summary:
      This ensures that we can use any tuple type in maps/other places where
      hashes are useful.  Since there's only one value for an empty tuple, just
      return 0.
      
      Reviewed By: ot
      
      Differential Revision: D14898947
      
      fbshipit-source-id: 8fefab46df32a6cc56e43b02346bbefe4d4ec567
      c1527c03
    • Caleb Marchent's avatar
      Travis split out docker ipv6 enable (#1108) · 0d0b02a4
      Caleb Marchent authored
      Summary:
      Split out enable IPv6 on docker into its own script.
      Do not do this on MacOS hosts; where we would not be running in a docker container.
      use apt add-on rather; which automatically disabled for non-apt supporting OSes (MacOSX)
      Pull Request resolved: https://github.com/facebook/folly/pull/1108
      
      Reviewed By: vitaut
      
      Differential Revision: D14899358
      
      Pulled By: calebmarchent
      
      fbshipit-source-id: 342e7a37e27317018d98d77e8603c896f34b3bc6
      0d0b02a4
    • Laurent Stacul's avatar
      Fix warning 'redundant-move' (#1107) · c12e5941
      Laurent Stacul authored
      Summary:
      Hello Facebook,
      
      This small PR to fix the redundant std::move usage detected by gcc (GCC) 9.0.1 20190225 (experimental)
      
      ```
      /folly/BUILD/folly-2019.04.01.00/folly/executors/task_queue/PriorityLifoSemMPMCQueue.h:92:30: error: redundant move in return statement [-Werror=redundant-move]
         92 |         return std::move(item);
            |                              ^
      ```
      
      Stac
      Pull Request resolved: https://github.com/facebook/folly/pull/1107
      
      Reviewed By: Orvid
      
      Differential Revision: D14874144
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: c65a422c500606103192b3d9377a52b4abf5a653
      c12e5941
  5. 11 Apr, 2019 5 commits
    • Michael Park's avatar
      Introduced `folly/executors/EDFThreadPoolExecutor`. · 5bd275f0
      Michael Park authored
      Summary: This patch introduces an earliest-deadline-first (EDF) executor: `folly/executors/EDFThreadPoolExecutor`.
      
      Reviewed By: interwq
      
      Differential Revision: D13983430
      
      fbshipit-source-id: 0df9bc4a1cdbe9059489d1e1abad88b9e6d17ad9
      5bd275f0
    • Caleb Marchent's avatar
      fbcode_builder support for using Python virtualenv (#76) · 6eecca09
      Caleb Marchent authored
      Summary:
      Needs to be enabled by option PYTHON_VENV in the config.
      
      shell_builder.py sets up the venv and uses it once; calling activate
      
      For docker we set ENV; resulting in the virtual environment being present
      when the resulting container is run as well as at build time. This is also cleaner
      and easier to follow than re-asserting on each RUN step.
      
      For Lego builder we need to source activate on each command as environment
      will not persist between commands.
      
      While man on the posts say it makes no sense to use virtualenv within docker
      container, this method simplifies the process considerably as we can rely on the
      name pip being valid and we don't need to either ensure we are root or pass the
      --user flag to pip and setuptools.
      
      Pull Request resolved: https://github.com/facebookincubator/LogDevice/pull/76
      
      Reviewed By: wez
      
      Differential Revision: D14875633
      
      Pulled By: calebmarchent
      
      fbshipit-source-id: aabbcdd509d2a59fa36f8004032a052f014ce1ba
      6eecca09
    • Kirk Shoop's avatar
      add take_until · 5b474b9d
      Kirk Shoop authored
      Summary: add take_until algorithm
      
      Reviewed By: ericniebler
      
      Differential Revision: D13697233
      
      fbshipit-source-id: b2e060bc88cb652dc196e4915961d811a97b414d
      5b474b9d
    • Caleb Marchent's avatar
      Add .pyc to gitignore · 1689b2f7
      Caleb Marchent authored
      Reviewed By: wez
      
      Differential Revision: D14890912
      
      fbshipit-source-id: 7ea8f28348d27131cf896bd8b5669153211af591
      1689b2f7
    • Long Cheng's avatar
      Cleanup SemiFutureTest · de260dd8
      Long Cheng authored
      Summary:
      - Removed unused EventBase
      - Simplified
      ```
      auto f = p.getSemiFuture().toUnsafeFuture();
      auto sf = std::move(f).semi().defer(...);
      ```
      
      to
      
      ```
      auto sf = p.getSemiFuture().defer(...);
      ```
      
      - Corrected `semiFutureWithinNoValueReferenceWhenTimeOut`. it wasn't testing anything because the future is not waited for and if it's waited for, `callbackInput` has exception, not value.
      
      Reviewed By: LeeHowes
      
      Differential Revision: D14877386
      
      fbshipit-source-id: 03df59af0339b20aa9e85506640e89cc383f3b9a
      de260dd8
  6. 10 Apr, 2019 4 commits
    • Orvid King's avatar
      AsyncServerSocket::AcceptCallback::connectionAccepted to NetworkSocket (attempt #2) · 3c6096c2
      Orvid King authored
      Summary:
      The file descriptor API here needs to go away, so switch this API to NetworkSocket
      
      It is expected that this commit will cause a number of Open Source projects to temporarily show up as broken. This is due to the fact that not all projects get synced to Github at the exact same time, so the builds may temporarily be fetching an older version of it's dependencies than it needs to :) It should fix itself quickly.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14673328
      
      fbshipit-source-id: c5842fa5dc383d50043e0d8228e35d03b10a1c6b
      3c6096c2
    • Yedidya Feldblum's avatar
      Address gcc-5.3 ice in pretty_name (#1106) · f75287f2
      Yedidya Feldblum authored
      Summary:
      [Folly] Address gcc-5.3 ice in `pretty_name`.
      
      Fixes #1105.
      
      Pull Request resolved: https://github.com/facebook/folly/pull/1106
      
      Reviewed By: Orvid
      
      Differential Revision: D14864700
      
      fbshipit-source-id: bd336135c8c39daca63e2a23fa5e9ea8589dd067
      f75287f2
    • Yedidya Feldblum's avatar
      Wait on the specified child in the rcu fork test · 41eed442
      Yedidya Feldblum authored
      Summary: [Folly] Wait on the specified child in the rcu fork test, v.s. waiting on any child. Makes the test more exact.
      
      Differential Revision: D14869269
      
      fbshipit-source-id: 2bb0110e5097f1dfe21602a09893a33e92421555
      41eed442
    • Doron Roberts-Kedes's avatar
      Introduce SIMDTable for ConcurrentHashMapSegment · 8ad6b845
      Doron Roberts-Kedes authored
      Summary:
      As an alternative to backend to BucketTable, introduce SIMDTable, which mimics the use of SSE intrinsics to filter tags as found in F14 code.
      
      On synthetic benchmarks, SIMDTable outperforms BucketTable by between 1.1x and 2.6x operations per second when the map does not fit in cache. However, when the map fits in cache SIMDTable executes around 10% fewer operations per second compared with BucketTable.
      
      BucketTable, the existing backend, remains the default.
      
      Reviewed By: djwatson
      
      Differential Revision: D14458269
      
      fbshipit-source-id: 5b6b01db5eb2430bdfc6f3500458f25971a6ad3d
      8ad6b845
  7. 09 Apr, 2019 12 commits
    • Yedidya Feldblum's avatar
      Handle Clang on Windows in pretty_name · 1060fb28
      Yedidya Feldblum authored
      Summary: [Folly] Handle Clang on Windows in `pretty_name`.
      
      Reviewed By: Orvid
      
      Differential Revision: D14844690
      
      fbshipit-source-id: 1f995604d5be0cd571caa344e5b18f877188390d
      1060fb28
    • Alejandro Mallea's avatar
      Removes unused function for non-MS compilers. · 47b5e69f
      Alejandro Mallea authored
      Summary:
      When building without Microsoft Visual C++, `do_nothing` is not used
      at all, potentially triggering unused function warnings, which makes it useless
      to compile with strict flags such as `-Wall -Werror`.
      
      Reviewed By: yfeldblum, aary
      
      Differential Revision: D14843227
      
      fbshipit-source-id: 28f0041ccae8bf07dc1f3e41e1cf67291c3d8447
      47b5e69f
    • Orvid King's avatar
      Fix Folly for C++ p0482 · 3621a2f9
      Orvid King authored
      Summary:
      TLDR; The element type of a utf8 string literal was changed from a `char` to a `char8_t`, which are incompatible. There is a paper that aims to resolve some of these issues, but the next version of MSVC has already implemented p0482, so we need to add a workaround for now.
      
      Fixes: https://github.com/facebook/folly/issues/1102
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14856705
      
      fbshipit-source-id: 983548cb0cb210341ec55d9dcdc63e726bfe4f62
      3621a2f9
    • Adam Norton's avatar
      Fix WindowTests · 70ebf75b
      Adam Norton authored
      Summary: `collect` short-circuits on an exception, so we need to wait for all the callbacks before deallocating the captured state
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14818841
      
      fbshipit-source-id: e7af2965b7641feff1e4230a6a66c7860994f826
      70ebf75b
    • Nathan Bronson's avatar
      add missing FOLLY_ALWAYS_INLINE to F14Map erase · 2b546a7a
      Nathan Bronson authored
      Summary:
      F14Map::erase(it) returns ++it for compatibility, but it
      is often discarded. erase(const_iterator) was marked always-inline to
      enable the computation of the return value to be optimized away, but the
      annotation was missing from erase(iterator).  This also adds always-inline
      annotations to a couple more methods that participate in the optimization,
      but they are very good candidates for inlining regardless.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14854278
      
      fbshipit-source-id: ad686b2dc8996b6a7c7038653a7c9ea1567e554d
      2b546a7a
    • Long Cheng's avatar
      Delete duplicated tests · b49e3a58
      Long Cheng authored
      Summary: Appear to be leftover from D8683752
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14854252
      
      fbshipit-source-id: bef87438201f9292fb0e5c62222d1a248163eda2
      b49e3a58
    • Doron Roberts-Kedes's avatar
      folly: Move reusable f14 code into F14Mask.h · 9bcd9d44
      Doron Roberts-Kedes authored
      Summary: Reusable mask/iter code moves into folly/container/detail/F14Mask.h. This is in preparation for reuse by SIMDTable in ConcurrentHashMap.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14729170
      
      fbshipit-source-id: fbf5e10a13eeb5e964f52d4fe262f9e5ae2e8f73
      9bcd9d44
    • Doron Roberts-Kedes's avatar
      Refactor folly::ConcurrentHashMapSegment to delegate internal work to BucketTable impl_ member · 6e6f1db2
      Doron Roberts-Kedes authored
      Summary:
      This sets the stage for D14458269, which adds a 2nd possible ImplT class.
      
      Move code shared between ImplT's into shared area.
      
      Work done in *_internal functions and functions that access member fields other than `batch_` now goes into this impl_ member.
      
      ConcurrentHashMapSegment basically is now just a wrapper that knows how to translate things like emplace, try_emplace, assign, etc. to various flavors of insert_internal. Changes to erase control flow are analogous.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D14458241
      
      fbshipit-source-id: 41d103141ead1eb306b6fe863932f00f827f68c3
      6e6f1db2
    • Joe Loser's avatar
      Fix deduction guide macro guard for Replaceable (#1097) · 5caa4e1d
      Joe Loser authored
      Summary:
      - `Replaceable` defines a deduction guide if the feature test macro for
        it is met, or if we are on MSVC. However, the MSVC version that folly
        supports also defines the feature test macro for deduction guides. As
        such, remove the extra check for MSVC.
      - Add `ReplaceableTest` to the  cmake build.
      - Add test for deduction guide.
      Pull Request resolved: https://github.com/facebook/folly/pull/1097
      
      Reviewed By: Orvid
      
      Differential Revision: D14699047
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: ee62bae0f4b05f1a110c2bd90470fecbb0666d24
      5caa4e1d
    • Yedidya Feldblum's avatar
      kIsClang · abc7ab99
      Yedidya Feldblum authored
      Summary: [Folly] `kIsClang`.
      
      Reviewed By: Igman
      
      Differential Revision: D14844691
      
      fbshipit-source-id: 80a738d5925d6d61e69f38ef5b43bf47691d233a
      abc7ab99
    • Orvid King's avatar
      Fix build of DistributedMutex · 9a38d122
      Orvid King authored
      Summary:
      It was broken, fix it.
      
      Fixes https://github.com/facebook/folly/issues/1092
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14842180
      
      fbshipit-source-id: 899c95fdac3622c78c9c6f326cd14898007ddf6c
      9a38d122
    • Orvid King's avatar
      Remove the fd overloads of AsyncPipe components · 845936ce
      Orvid King authored
      Summary: They're dead
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14838871
      
      fbshipit-source-id: 4b136d7a5914a1564f32bb87e6bec2b8d1411829
      845936ce
  8. 08 Apr, 2019 1 commit
    • Eric Niebler's avatar
      Simplify constraints on operator co_await for SingleTypedSenders · fab6cad7
      Eric Niebler authored
      Summary: Because of the guard against constraint recursion in the definition of `struct awaitable_sender_traits` (awaitable/concepts.h, line 75), there is no need to be so conservative with the constraints of the generic `operator co_await` for `SingleTypedSender`s.
      
      Reviewed By: kirkshoop
      
      Differential Revision: D14816672
      
      fbshipit-source-id: b2f49588ae98ea63a24f4044692470c59be15e29
      fab6cad7