1. 03 Sep, 2020 11 commits
    • Dan Melnic's avatar
      Check result against kBlockSize · 832a9353
      Dan Melnic authored
      Summary: Check result against kBlockSize
      
      Reviewed By: kevin-vigor
      
      Differential Revision: D23501893
      
      fbshipit-source-id: b6a43474422049c93f02e0b5defd300a471bccf5
      832a9353
    • Ivan Murashko's avatar
      Fix for compilation errors on a build without precompiled headers (#1438) · 5758ff24
      Ivan Murashko authored
      Summary:
      Pull Request resolved: https://github.com/facebook/folly/pull/1438
      
      The file `folly/experimental/io/test/IoTestTempFileUtil.h` does not have `pragma once` and can be included several times. It produces compilation errors.
      
      Reviewed By: Orvid
      
      Differential Revision: D23496733
      
      fbshipit-source-id: 0309847f60992b21d07b2377d49539d78570fb09
      5758ff24
    • Raul Tambre's avatar
      CMake: Handle generator expressions requiring a target for pkg-config (#1433) · eedb340b
      Raul Tambre authored
      Summary:
      CMake's find modules may have target-based generator expressions, which get propagated to us when generating the pkg-config file.
      CMake 3.19 introduces the TARGET argument to file(GENERATE), which allows resolving such generator expressions and will avoid future issues.
      A workaround proposed by adriaandegroot is added for CMake 3.18.
      
      Additionally changed list->string conversion to use list(JOIN) instead of string replacement.
      
      Fixes https://github.com/facebook/folly/issues/1414.
      
      Pull Request resolved: https://github.com/facebook/folly/pull/1433
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23433365
      
      Pulled By: Orvid
      
      fbshipit-source-id: 6ef5f180e13b41f0c92137f53fd8c19ba6355dd6
      eedb340b
    • Yedidya Feldblum's avatar
      Fix possible UB in constexpr_strcmp · 9be79676
      Yedidya Feldblum authored
      Summary: [Folly] Fix possible UB in `constexpr_strcmp` since signed arithmetic wraparound is undefined.
      
      Differential Revision: D23435902
      
      fbshipit-source-id: f71103f58f9a1a69dbc7fa462703605d1fc78348
      9be79676
    • Andrii Grynenko's avatar
      Don't rely on pthread_atfork when possible · 2948741d
      Andrii Grynenko authored
      Summary:
      Because of https://github.com/google/sanitizers/issues/1116, any races detected during pthread_atfork deadlock the process.
      For forks issued from folly we can use an instrumented fork version to minimize the amount of code running via pthread_atfork.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23281093
      
      fbshipit-source-id: fd4d3bf06b7992ff314f631ed899854a8b3f6c4b
      2948741d
    • Yedidya Feldblum's avatar
      Cut FOLLY_CREATE_HAS_MEMBER_TYPE_TRAITS · f57cccc9
      Yedidya Feldblum authored
      Summary: [Folly] Cut `FOLLY_CREATE_HAS_MEMBER_TYPE_TRAITS` since its margin of utility is too small given `folly::is_detected`.
      
      Reviewed By: Mizuchi
      
      Differential Revision: D23371271
      
      fbshipit-source-id: 6db49163d54ffd4d862bb98345d0e71b4d114674
      f57cccc9
    • Robin Cheng's avatar
      Make SmallLocksTest pass under TSAN if halt_on_error=0. · ec658b16
      Robin Cheng authored
      Summary: When setting halt_on_error to 0 (which is the default setting now for TSAN in fbcode because we want to catch all bugs), a deadlock does not immediately cause an issue. So we include exit(0) as part of the death test to handle that case.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23493015
      
      fbshipit-source-id: fb4910edddab11e1cd00e402b6b7350a6dc941a7
      ec658b16
    • Katie Mancini's avatar
      add re2 as cmake dependency · 81ee35a5
      Katie Mancini authored
      Summary:
      We use Re2 in D22877942 for parsing multiple path prefix data fetch logging,
      this introduces the dependency for eden's opensource builds.
      
      Reviewed By: chadaustin
      
      Differential Revision: D23431175
      
      fbshipit-source-id: 44b399e92cb89ba1403295ecd10bc8f8d769b02c
      81ee35a5
    • Yedidya Feldblum's avatar
      Simplify the fallback constexpr strlen, strcmp · 4a8a285d
      Yedidya Feldblum authored
      Summary: [Folly] Simplify the fallback implementations of `constexpr_strlen` and `constexpr_strcmp` by taking advantage of C++14 `constexpr` syntax.
      
      Differential Revision: D23416900
      
      fbshipit-source-id: 93a969282faa61b3c9ff8e75519ad4e6edd71e4e
      4a8a285d
    • Robin Cheng's avatar
      Adjust stack limits for StackTraceSizeLimitTest for TSAN. · ec9d37a5
      Robin Cheng authored
      Summary: TSAN just needs more stack doing this...
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23484864
      
      fbshipit-source-id: e5412982349f73f8ead795403dfbde2830f4e5fd
      ec9d37a5
    • Robin Cheng's avatar
      Skip a test in StackTraceTest under TSAN because it calls signal unsafe functions. · 8b53f907
      Robin Cheng authored
      Summary: Apparently the code says, being signal unsafe is OK because the signal is created with raise(). So let's just skip that test under TSAN.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23484012
      
      fbshipit-source-id: 697234b9f57db97c6c6aaf8131058d3ecec3d059
      8b53f907
  2. 02 Sep, 2020 7 commits
    • Shai Szulanski's avatar
      Drop unit in folly::coro::toTask · 2044c0c6
      Shai Szulanski authored
      Summary:
      To preserve void type in roundtrip
      Doing this generically is pretty gross (you need to check if awaiter_type<decltype(co_viaIfAsync({}, SemiAwaitable))> has a member await_resume_try), while the cost of adding explicit overloads is low as there are only two types we care about, so I chose to do it that way.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23407270
      
      fbshipit-source-id: cc952e2d8fa4297dbe363e22e99192fdf858134f
      2044c0c6
    • Lewis Baker's avatar
      Add Timekeeper parameter to folly::coro::retryWithExponentialBackoff() · 659deb38
      Lewis Baker authored
      Summary:
      The Timekeeper parameter can be used to pass in manually-controlled time-sources
      for testing purposes if required.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23386677
      
      fbshipit-source-id: bea09292b00f6cd018568d26e5409d2c7ff01dbe
      659deb38
    • Yedidya Feldblum's avatar
      Test constexpr_strlen, constexpr_strcmp fallbacks · 6b2d55ec
      Yedidya Feldblum authored
      Summary: [Folly] Test `constexpr_strlen`, `constexpr_strcmp` fallback implementations alongside the main implementations, since the main implementations may fall back to the fallback implementations on some platforms but not on others, and we may only be testing on the other platforms.
      
      Differential Revision: D23432301
      
      fbshipit-source-id: 271705cb8c2b1ab6d11c1be20e2c3023cacab583
      6b2d55ec
    • Yedidya Feldblum's avatar
      Cut FOLLY_CREATE_HAS_MEMBER_FN_TRAITS · 3b18d435
      Yedidya Feldblum authored
      Summary: [Folly] Cut `FOLLY_CREATE_HAS_MEMBER_FN_TRAITS` since it is unused and does not match the current invoker model, replacing uses which need it with `FOLLY_CREATE_MEMBER_INVOKER`.
      
      Reviewed By: vitaut
      
      Differential Revision: D23371070
      
      fbshipit-source-id: 7fb0f5af21321a5056e06933ebd364a0a48a8fa1
      3b18d435
    • Shai Szulanski's avatar
      Add folly::coro::makeTask · d61f81cc
      Shai Szulanski authored
      Summary: Reduce boilerplate when defining simple coroutines, e.g. in tests
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23404552
      
      fbshipit-source-id: a19e9cb6640e3897d3c166499014ebe4c19fbf04
      d61f81cc
    • Giuseppe Ottaviano's avatar
      Fix atomic_shared_ptr tests · 69f66b7e
      Giuseppe Ottaviano authored
      Summary: D9312236 (https://github.com/facebook/folly/commit/bc16b096b1f6659e29379a650998bbfcf0c03eca) made these tests conditional on using libstdc++, but the header that defines the macro is not included prior to the `#ifdef`, so the tests (and benchmarks) are disabled unconditionally.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23469536
      
      fbshipit-source-id: 2ab0b2d28748419d88e946eff9b09b98d361dedb
      69f66b7e
    • Yedidya Feldblum's avatar
      Revise is_transparent_v and is_transparent · c5adaa59
      Yedidya Feldblum authored
      Summary: [Folly] Revise `is_transparent_v` as a variable and as eager, and atop `is_detected`, and `is_transparent` as a type and as deferred.
      
      Reviewed By: Mizuchi
      
      Differential Revision: D23367991
      
      fbshipit-source-id: be30184b04e2a1977db3faccd57e947dd33282ce
      c5adaa59
  3. 01 Sep, 2020 7 commits
    • Maged Michael's avatar
      hazptr: Rename warning function · 92a2a9b3
      Maged Michael authored
      Summary:
      Change name of warning_list_too_large to hazptr_warning_list_too_large for consistency with other hazptr warning functions.
      
      Add missing  FOLLY_EXPORT.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23436826
      
      fbshipit-source-id: 149c62c9d1cd3320ef525a90c0b591b274228054
      92a2a9b3
    • Yedidya Feldblum's avatar
      is_detected · 2d4d958f
      Yedidya Feldblum authored
      Summary: [Folly] `is_detected`, for a common pattern around `void_t`, backported from Library Fundamentals TS v2.
      
      Reviewed By: Mizuchi
      
      Differential Revision: D23367990
      
      fbshipit-source-id: 3a0e9a5b7eb668f872ce699757e32bb620bb5404
      2d4d958f
    • Dan Melnic's avatar
      Add support for microsecond intervals in the function scheduler · 354e50d4
      Dan Melnic authored
      Summary: Add support for microsecond intervals in the function scheduler
      
      Reviewed By: arushiagg
      
      Differential Revision: D23433411
      
      fbshipit-source-id: 39d201feaaed8007ec880a799129ed94bedd827a
      354e50d4
    • Dan Melnic's avatar
      Add io_uring registered buffers support · 16d63941
      Dan Melnic authored
      Summary: Add io_uring registered buffers support
      
      Reviewed By: kevin-vigor
      
      Differential Revision: D23421043
      
      fbshipit-source-id: b9c6a4bbd7a6b6cc580b1e3f64320d9e59d04ab2
      16d63941
    • Yedidya Feldblum's avatar
      Revise is_instantiation_of_v and is_instantiation_of · 6226f8a2
      Yedidya Feldblum authored
      Summary: [Folly] Revise is_instantiation_of_v as a variable and as eager, and is_instantiation_of as a type and as deferred.
      
      Reviewed By: Mizuchi
      
      Differential Revision: D23367989
      
      fbshipit-source-id: bf6ebd74b8e7758818dfcebd04152e1297bc99e4
      6226f8a2
    • Lucian Grijincu's avatar
      folly: doNotOptimizeAway + makeUnpredictable to their own library: folly/BenchmarkUtil.h · 8132af20
      Lucian Grijincu authored
      Summary: These lightweight functions are useful on their own, but were tied to `Benchmarking.h` & all their dependencies.
      
      Reviewed By: yfeldblum, ot
      
      Differential Revision: D20239087
      
      fbshipit-source-id: 644601b6f869191db1492d0738f3af723b9e0f4b
      8132af20
    • Victor Zverovich's avatar
      Fix LoggerTest · 0dd60e57
      Victor Zverovich authored
      Summary: Fix overspecified LoggerTest.
      
      Reviewed By: yfeldblum, simpkins
      
      Differential Revision: D23425421
      
      fbshipit-source-id: ecfd7d0e73555b3a94a81b54ffd1287bf9664697
      0dd60e57
  4. 31 Aug, 2020 3 commits
  5. 28 Aug, 2020 8 commits
    • Chad Austin's avatar
      stop using deprecated std::iterator · 8dc2d39f
      Chad Austin authored
      Summary:
      std::iterator was deprecated in C++17, so define the iterator trait
      properties directly. This fixes warnings during compilation with Clang
      on Windows.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23353495
      
      fbshipit-source-id: 7c6c0b7fb175251260e5b519ce98bd679b6c99c4
      8dc2d39f
    • Dan Melnic's avatar
      Add support for async range submit · db7a54ac
      Dan Melnic authored
      Summary: Add support for async range submit
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23389493
      
      fbshipit-source-id: 7171893a2eeccc20fcdd625e98f88d365027c930
      db7a54ac
    • Andrii Grynenko's avatar
      Workaround for TSAN symmetric transfer bug · 135f8252
      Andrii Grynenko authored
      Summary: TSAN breaks symmetric transfer behavior in compiler. Work around it by rescheduling work on executor when possible.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23391328
      
      fbshipit-source-id: 7b25a0c89664ca14114f8ae0dc650ff9bb786fe1
      135f8252
    • Dan Melnic's avatar
      Switch from VLA to folly::small_vector · 687f3fe8
      Dan Melnic authored
      Summary: Switch from VLA to folly::small_vector
      
      Reviewed By: yfeldblum, ot
      
      Differential Revision: D23391426
      
      fbshipit-source-id: c6c61f3f0eef5b6e71ad3a639fcfdb4fa1b7268e
      687f3fe8
    • Dan Melnic's avatar
      Add support for microsecond intervals in the function scheduler · defe385b
      Dan Melnic authored
      Summary: Add support for microsecond intervals in the function scheduler
      
      Reviewed By: yfeldblum, Mizuchi
      
      Differential Revision: D23153179
      
      fbshipit-source-id: 10f18d7b774c47659fe8191f8d92dca341e1cf97
      defe385b
    • Yedidya Feldblum's avatar
      Remove the guard around tag · d2a3bb4f
      Yedidya Feldblum authored
      Summary: [Folly] Remove the guard around `tag`, the inline variable of type `tag_t`.
      
      Reviewed By: Mizuchi
      
      Differential Revision: D23370037
      
      fbshipit-source-id: 59a48d834904b7e503f807c62fff8534568c9a0a
      d2a3bb4f
    • Andrew Smith's avatar
      Make folly::coro::co_invoke work with folly::coro::Generator · 28cc462f
      Andrew Smith authored
      Summary: This diff makes folly::coro::co_invoke work with folly::coro::Generator.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23332912
      
      fbshipit-source-id: b3e25d160a94aed8892bf55ad5007f4018786e47
      28cc462f
    • Lewis Baker's avatar
      Add folly::coro::AsyncScope::remaining() · 4c6cb736
      Lewis Baker authored
      Summary:
      Add a method for querying the number of remaining tasks
      that have been added to an AsyncScope but that have not
      yet completed.
      
      This can be useful for implementing some load-shedding
      strategies based on the current number of active tasks
      added to a scope.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D21461637
      
      fbshipit-source-id: 628c236e0c99fa952e63f84366186246e5286bc8
      4c6cb736
  6. 27 Aug, 2020 2 commits
    • Zhengxu Chen's avatar
      Update OSS CMakeLists.txt to use CMAKE_CXX_STANDARD · 9fdb0d52
      Zhengxu Chen authored
      Summary: Adjust low level deps in OSS builds to use standard `CMAKE_CXX_STANDARD` variables to control std level in cpp builds.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23333713
      
      fbshipit-source-id: cd76712d6b045f1d0aff30d4874d9bf0ce6f1e01
      9fdb0d52
    • Yedidya Feldblum's avatar
      Use C++ to check for mobile in IOBuf · 8af2de83
      Yedidya Feldblum authored
      Summary:
      [Folly] Use C++ v.s. the preprocessor to check for mobile in `IOBuf`.
      
      Using C++ allows the compiler, when compiling for any platform, to see the full code for every platform and to typecheck and report errors.
      
      Reviewed By: aditya7fb
      
      Differential Revision: D23365674
      
      fbshipit-source-id: 9cfe048a3114be3d6ef4522e279e19fb21f50a17
      8af2de83
  7. 26 Aug, 2020 2 commits
    • Chad Austin's avatar
      unconditionally build symbolizer sources even if FOLLY_USE_SYMBOLIZER is unset... · 90ab2b68
      Chad Austin authored
      unconditionally build symbolizer sources even if FOLLY_USE_SYMBOLIZER is unset or the platform is non-ELF
      
      Summary:
      Rather than conditionally include the folly symbolizer sources in the
      CMake build, always build them, and add appropriate dependency defines
      to conditionally enable functionality.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D22970595
      
      fbshipit-source-id: 957242b7fde28584edd78a1a6dbe9f830e98e726
      90ab2b68
    • Robin Cheng's avatar
      Disable some slow StlVectorTest cases under TSAN. · 6da515d7
      Robin Cheng authored
      Summary: These tests time out under TSAN and there's not much value to run them under TSAN because the tests are single-threaded.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D23302147
      
      fbshipit-source-id: 6fc8bd3e29c9cde72bfa85a14fd7726850540285
      6da515d7