1. 01 Apr, 2021 10 commits
    • condy's avatar
      Direct initialize semaphoreWaiter (#1554) · 91ef8d68
      condy authored
      Summary:
      Before this patch, it relies on the c++17 guaranteed copy elision, since `SemaphoreBase::Waiter` is NOT copy constructible due to `std::atomic<intptr_t>`.
      
      This patch makes it compile even using `-std=c++14`.
      
      Pull Request resolved: https://github.com/facebook/folly/pull/1554
      
      Differential Revision: D27505938
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 6c26f82f77a24236a1233cff7921cd6b9f53bd09
      91ef8d68
    • Lee Howes's avatar
      Remove dead includes in folly/io · 2fd1e607
      Lee Howes authored
      Reviewed By: yfeldblum
      
      Differential Revision: D27461546
      
      fbshipit-source-id: 500ecd312b0b0ba15db7f373a3b6c7d633802846
      2fd1e607
    • Sandeep Kumar Pani's avatar
      OSS jobs to tpx · 6f1d51be
      Sandeep Kumar Pani authored
      Summary:
      Tpx works well for all OSS jobs, we should migrate to Tpx instead of
      relying testpilot.
      
      Reviewed By: marcelogomez
      
      Differential Revision: D27396539
      
      fbshipit-source-id: dd1994be0eb3b4396764c1f3e68ddd6763b60139
      6f1d51be
    • generatedunixname89002005287564's avatar
      Remove dead includes in folly/hash · 105cc30d
      generatedunixname89002005287564 authored
      Reviewed By: yfeldblum
      
      Differential Revision: D27461452
      
      fbshipit-source-id: 3e46ba71b10aea10d6006c3c6f145377ce6687da
      105cc30d
    • generatedunixname89002005287564's avatar
      Remove dead includes in folly/system · fbf1aff8
      generatedunixname89002005287564 authored
      Reviewed By: yfeldblum
      
      Differential Revision: D27461464
      
      fbshipit-source-id: 53facc1cc42f60ffa3083c12c32352bb78b16280
      fbf1aff8
    • Yedidya Feldblum's avatar
      shrink SingletonRelaxedCounter inline slow path · 85bc0de2
      Yedidya Feldblum authored
      Summary: Persuade the compiler to emit a tail call in the `SingletonRelaxedCounter` inline slow path.
      
      Differential Revision: D27383131
      
      fbshipit-source-id: 6f58b1eb23477c00221515d7d6e55a91668f7c84
      85bc0de2
    • Yedidya Feldblum's avatar
      remove folly::SpinLockGuard · 7426f02a
      Yedidya Feldblum authored
      Summary:
      C++17 permits use of `std::unique_lock` instead of `folly::SpinLockGuard`; just use that.
      
      C++11 permits use of `std::unique_lock<SpinLock>`.
      
      Differential Revision: D27390136
      
      fbshipit-source-id: bcc34a043644289523ddfdfbf47a260c133db186
      7426f02a
    • Andrii Grynenko's avatar
      Don't throw in noexcept ViaIfAsyncAwaiter::await_suspend · e4fb76b6
      Andrii Grynenko authored
      Summary: Avoids warnings with -Wterminate.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D27452798
      
      fbshipit-source-id: 129b66179c5ff9bbf3f8fe791224cd925a3b33f3
      e4fb76b6
    • Shrikrishna Khare's avatar
      Update OpenNSA manifest to latest 6.5.21 · 716ff89f
      Shrikrishna Khare authored
      Summary:
      This is towards upgrading to newer OpenNSA 6.5.21.
      
      This diff will be landed after we have verified that OpenNSA 6.5.21 has not
      regressed from OpenNSA 6.5.19 (HW test results)
      
      sha256sum on the tarball, and use that in the manifest.
      
      Reviewed By: jasmeetbagga
      
      Differential Revision: D27470306
      
      fbshipit-source-id: a56c1e012a790b0bc948a5804dd605cdf224916c
      716ff89f
    • generatedunixname89002005287564's avatar
      Remove dead includes in folly/stats · b7c8b2ff
      generatedunixname89002005287564 authored
      Reviewed By: yfeldblum
      
      Differential Revision: D27461647
      
      fbshipit-source-id: cf1f9747b535a9fb8c8aa851f2ce9cad8b9dce61
      b7c8b2ff
  2. 31 Mar, 2021 3 commits
    • Phil Willoughby's avatar
      expose LockFreeRingBuffer internal address/size · e2d5a3f6
      Phil Willoughby authored
      Summary: This is useful if your environment takes partial dumps of the process on crash - you can tell the process which does that to include the memory range of the flight recorder in what is dumped.
      
      Differential Revision: D27206631
      
      fbshipit-source-id: b3679004930486094e6030b5b39ee02d01bc7617
      e2d5a3f6
    • Yedidya Feldblum's avatar
      Stop purging arenas in MemoryIdler · 02e534fb
      Yedidya Feldblum authored
      Summary:
      jemalloc has background threads to purge unused pages, so stop purging
      arenas used by idle threads since those arenas may be shared with active
      threads which must page fault new pages in after the purge
      
      Reviewed By: ot, davidtgoldblatt
      
      Differential Revision: D26793042
      
      fbshipit-source-id: 13617bfb0ace1c5b7aae52dfdc428b19ff99f7bf
      02e534fb
    • Nathan Lanza's avatar
      Mark some destructors that are overriden as `override` · deb71d74
      Nathan Lanza authored
      Summary: This satisfies a new error in llvm11
      
      Reviewed By: smeenai
      
      Differential Revision: D27421459
      
      fbshipit-source-id: 963d809a4f430a365223786ea7d2591fe239062f
      deb71d74
  3. 30 Mar, 2021 4 commits
  4. 29 Mar, 2021 7 commits
    • Dan Melnic's avatar
      IOBuf combine allocations only within size classes · 59b71bbb
      Dan Melnic authored
      Summary: IOBuf allocate SharedInfo in the same allocation only if we do not cross into the next class size
      
      Reviewed By: jrahman
      
      Differential Revision: D27353914
      
      fbshipit-source-id: 65be3641d7eaa0588bf26101ce02668fb827eee9
      59b71bbb
    • Pranjal Raihan's avatar
      ReadMostlyAtomicObserver and minor cleanup · 25cfb031
      Pranjal Raihan authored
      Summary:
      `folly::observer::ReadMostlyAtomicObserver` docblock explains it well:
      ```
      /**
       * A ReadMostlyAtomicObserver guarantees that reading is exactly one relaxed
       * atomic load. Like AtomicObserver, the value is cached using `std::atomic`.
       * However, there is no version check when reading which means that the
       * cached value may be out-of-date with the Observer value. The cached value
       * will be updated asynchronously in a background thread.
       *
       * Because there is no version check when reading, ReadMostlyAtomicObserver
       * does not capture observer dependencies when used from makeObserver. It is not
       * possible to create a dependent observer. Therefore, ReadMostlyAtomicObserver
       * models none of CopyConstructible, MoveConstructible, CopyAssignable, or
       * MoveAssignable. Dependent observers should be created using the underlying
       * observer.
       *
       * ReadMostlyAtomicObserver is ideal for fastest possible reads on a
       * trivially-copyable type when a slightly out-of-date value will suffice. It is
       * perfect for very frequent reads coupled with very infrequent writes.
       */
      ```
      Other minor changes:
      * Added `getUnderlyingObserver` to each of the special-purpose observers.
      * Sprinkled `std::move` where neccessary.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D27381490
      
      fbshipit-source-id: fed039ae481af0c4e4148f80df03e30a125e333f
      25cfb031
    • Ruslan Sayfutdinov's avatar
      define HOST_NAME_MAX for Windows and Mac · cae314d6
      Ruslan Sayfutdinov authored
      Summary:
      This page says it can't be greater than 256:
      https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-gethostname
      
      POSIX one is equal to 255, so set it to 255.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D27370716
      
      fbshipit-source-id: 458ebc02d2914a0422862fafedd089e0c13c5e6d
      cae314d6
    • Pedro Eugenio Rocha Pedreira's avatar
      Add libicu manifest · 0be01410
      Pedro Eugenio Rocha Pedreira authored
      Summary: Adding libicu manifest, which will be used by f4d/velox
      
      Reviewed By: amitkdutta
      
      Differential Revision: D25934666
      
      fbshipit-source-id: 247d9961c90fcfc497498b556626e9ef1739b191
      0be01410
    • Doug Huff's avatar
      NestedCommandLineApp Add -h as an alias for --help globally and to all subcommands · 3a967c59
      Doug Huff authored
      Summary: Alias `-h` to `--help` because we live in a society.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D27370742
      
      fbshipit-source-id: eb346546fe4066eef62313176ff7e47c20e507be
      3a967c59
    • Jianfeng Tang's avatar
      Fix one compilation warning - implicit conversion · 552024d3
      Jianfeng Tang authored
      Summary: As titled. Convert float to int explicitly to get rid of compilation warning.
      
      Reviewed By: therealgymmy
      
      Differential Revision: D27364578
      
      fbshipit-source-id: a5f53142be9ba64260e7028d29c89a857ed66770
      552024d3
    • Ruslan Sayfutdinov's avatar
      support coroutines for clang on windows · 82e4fd9e
      Ruslan Sayfutdinov authored
      Summary: `LLVM_COROUTINES` define indicates that LLVM compatible `<experimental/coroutine>` is available and we can enable coroutines for Clang on Windows.
      
      Reviewed By: yfeldblum, WillerZ
      
      Differential Revision: D26729942
      
      fbshipit-source-id: 37999a9a727727aa9244e8d4d67f035fc311be50
      82e4fd9e
  5. 28 Mar, 2021 3 commits
    • Dan Melnic's avatar
      SharedMutex TSAN: call destroy only if the annotation was created · 8aeb9ba9
      Dan Melnic authored
      Summary:
      SharedMutex TSAN: call destroy only if the annotation was created
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D27379654
      
      fbshipit-source-id: 90be62eb9e932c83e025a96dd36c4cba992e6267
      8aeb9ba9
    • Lucian Grijincu's avatar
      folly::Try: add value_or() implementations mimicking std::optional::value_or API · 6d8bd01c
      Lucian Grijincu authored
      Summary:
      Add API equivalent to `std::optional::value_or`: https://en.cppreference.com/w/cpp/utility/optional/value_or
      
      Returns the contained value if *this has a value, otherwise returns default_value.
      
        template< class U > constexpr T value_or( U&& default_value ) const&;
      
      Equivalent to `bool(*this) ? **this : static_cast<T>(std::forward<U>(default_value))`
      
         template< class U > constexpr T value_or( U&& default_value ) &&;
      
      Equivalent to `bool(*this) ? std::move(**this) : static_cast<T>(std::forward<U>(default_value))`
      
      Reviewed By: yfeldblum
      
      Differential Revision: D27346319
      
      fbshipit-source-id: 598b740cb9068cffb0cc0fbda3579e64fd125e8b
      6d8bd01c
    • Giuseppe Ottaviano's avatar
      Inline the assume() check in debug mode · d3f0a283
      Giuseppe Ottaviano authored
      Summary: Even in debug mode, the branch can likely be coalesced with the actual condition if inlined.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D27285173
      
      fbshipit-source-id: 1662588f82d14a5ab2c9564bab5cec72981418ec
      d3f0a283
  6. 26 Mar, 2021 5 commits
  7. 25 Mar, 2021 5 commits
  8. 24 Mar, 2021 3 commits
    • TJ Yin's avatar
      Make RWCursor constructible from IOBufQueue · fb645211
      TJ Yin authored
      Summary: This diff added conversion from `IOBufQueue` and `QueueAppender` to `RWCursor`. It's safe to use `RWCursor` to mutate the their underlying `IOBuf` since the structure of `IOBuf` won't changed. It's worth noting appending data to `IOBufQueue` will invalidate RWCursor (just like iterator).
      
      Reviewed By: yfeldblum
      
      Differential Revision: D27257697
      
      fbshipit-source-id: 17887d656a6095afe1c6882426457b9e75a66c84
      fb645211
    • Michel Salim's avatar
      handle non-constant SIGSTKSZ · 7df2d7e5
      Michel Salim authored
      Summary:
      On glibc > 2.33 (e.g. on Fedora rawhide/35), `SIGSTKSZ` is no longer constant:
      http://sourceware-org.1504.n7.nabble.com/PATCH-sysconf-Add-SC-MINSIGSTKSZ-SC-SIGSTKSZ-BZ-20305-td650948.html
      
      Assume it's non-constant, and so:
      - use `std::max` rather than `folly::constexpr_max` to compute the stack size
      - cast both arguments to `size_t` since in the non-constant case we get a `long int` back
      - use `std::unique_ptr<char[]>` and compute the size at the time of use rather than make it class-wide
      
      Reviewed By: yfeldblum
      
      Differential Revision: D27143320
      
      fbshipit-source-id: 7dcdd7cf3d5e96db605266504f443cf2b48ba18c
      7df2d7e5
    • Srivatsan Ramesh's avatar
      Using reply struct instead of folly::Function · 5b373171
      Srivatsan Ramesh authored
      Summary: Using folly::Function as node type for EventBaseAtomicNotificationQueue involves two mallocs (for creating the function and also to create the queue node). In this diff, I have created a class to hold the data required to send replies and using emplaceMessage to add to the queue.
      
      Differential Revision: D26778920
      
      fbshipit-source-id: 2dcf8395dc77db1d7c73d1d68c9a69e767191b95
      5b373171