1. 02 Apr, 2019 10 commits
    • Michael Park's avatar
      Strengthened `const`-ness of `ThreadPoolExecutor`, and its derived classes. · e8e6817c
      Michael Park authored
      Summary: It was observed in D14238146 that `ThreadPoolExecutor::numThreads()` is not marked `const`, and it seems that it really should be. This patch marks that function `const` as well as others in this class that seems they should be `const`.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14681960
      
      fbshipit-source-id: f274b9788ae7e27d6bec22aec2818abeb6441531
      e8e6817c
    • Yedidya Feldblum's avatar
      PriorityUnboundedQueueSet, wrapping UnboundedQueue · 74f36602
      Yedidya Feldblum authored
      Summary: [Folly] `PriorityUnboundedQueueSet`, wrapping `UnboundedQueue`.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D14719777
      
      fbshipit-source-id: 529ddd8de5879908e36f6fc26e7a091230cb03da
      74f36602
    • Wez Furlong's avatar
      folly: workaround AsyncTimeoutTest ICE with gcc 8 · 8ea8b06a
      Wez Furlong authored
      Summary:
      ```
      folly/io/async/test/AsyncTimeoutTest.cpp: In lambda function:
      folly/io/async/test/AsyncTimeoutTest.cpp:31:70: internal compiler error: Segmentation fault
             AsyncTimeout::make(manager, [&]() noexcept { value = expected; });
                                                                            ^
      Please submit a full bug report,
      with preprocessed source if appropriate.
      See <http://bugzilla.redhat.com/bugzilla> for instructions.
      ```
      
      I'm using:
      
      ```
       $ /opt/rh/devtoolset-8/root/usr/bin/c++ --version
      c++ (GCC) 8.2.1 20180801 (Red Hat 8.2.1-2)
      Copyright (C) 2018 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      ```
      
      This has been fixed in gcc 8.3, but the workaround is to explicitly
      name the captures as is done in this diff.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14702587
      
      fbshipit-source-id: 1998ef5de8eb4df520edcc41fdc9cd9547dec824
      8ea8b06a
    • Wez Furlong's avatar
      folly:wangle: fixup libevent detection and export · 9a29672d
      Wez Furlong authored
      Summary:
      I finally got to the bottom of the weird `-levent` or `event.lib`
      linker errors that crop up in the cmake builds.
      
      The issue is that if you have installed a recent libevent it deploys
      a cmake CONFIG package that exports just a bare `event` target as the
      dep on libevent.  This is unfortunate because it is interpreted as
      meaning `-levent` with no library path, which for an installation
      of libevent that is not in the default path will result in linker
      errors in libraries downstream of folly.
      
      To resolve this, I've given the common `FindLibEvent.cmake` file
      (that was derived from the folly library of the same name) a similar
      treatment to the recent changes to find glog and taught it how to
      locate libevent from a config package and to fall back on a basic
      include/library check.
      
      If we find an `event` target then we extract the actual library
      path from it and export that.
      
      I've removed folly's and wangle's own FindLibEvent.cmake so that it will pick
      up the common library which gets shipit sync'd out to
      https://github.com/facebook/folly/blob/master/CMake/FindLibEvent.cmake
      and https://github.com/facebook/wangle/blob/master/build/fbcode_builder/CMake/FindLibEvent.cmake
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14702577
      
      fbshipit-source-id: d35d9f741e009dcd77976c0637ba3024a8a4aef3
      9a29672d
    • Wez Furlong's avatar
      folly: fix FutureDAGTest compilation · fc3937b5
      Wez Furlong authored
      Summary:
      ```
      folly/experimental/test/FutureDAGTest.cpp:46:7: error: ‘source_node’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
             if (it->first != source_node) {
             ^~
      cc1plus: all warnings being treated as errors
      ```
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14702569
      
      fbshipit-source-id: 949ecde007a8d84498c5d87f4a4c2db463ba83a9
      fc3937b5
    • Wez Furlong's avatar
      folly: fix IOBufCursorTest · b168f451
      Wez Furlong authored
      Summary:
      ```
      folly/folly/io/test/IOBufCursorTest.cpp:212:3:
      folly/folly/io/Cursor.h:411:13: error: ‘void* memcpy(void*, const void
      *, size_t)’ forming offset [13, 20] is out of the bounds [0, 12] of object ‘buf’ with type ‘char [12]’ [-Werror=array-bounds]
             memcpy(buf, data(), len);
             ~~~~~~^~~~~~~~~~~~~~~~~~
      ```
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14702563
      
      fbshipit-source-id: 3697a021d71bccfae9d8833b42a0c25e916b7a78
      b168f451
    • Wez Furlong's avatar
      folly: fix string truncation warning in LockFreeRingBufferTest · c6ad789e
      Wez Furlong authored
      Summary:
      ```
      folly/experimental/test/LockFreeRingBufferTest.cpp:279:14: error
      : ‘char* strncpy(char*, const char*, size_t)’ output may be truncated copying 1023 bytes from a string of length 1023 [-Werror=stringop-truncation]
             strncpy(data_, data.data_, sizeof(data_) - 1);
             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ```
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14702561
      
      fbshipit-source-id: 8f85c758c7afc99eeb1f95920511fb4195eafbbe
      c6ad789e
    • Lewis Baker's avatar
      Make folly::coro::Mutex lock operations SemiAwaitable · ab0aeeea
      Lewis Baker authored
      Summary:
      Making the `co_scoped_lock()` and `co_lock()` operations semi-awatitable forces the caller to provide an executor on which to resume the awaiting coroutine in the case that the lock could not be acquire synchronously.
      
      This improves the safety of folly::coro::Mutex when used from within an InlineTask which does not implicitly wrap all co_await expressions to ensure transitions back to the executor and would otherwise implicitly resume the next lock-acquirer inline inside the call to .unlock().
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D14708636
      
      fbshipit-source-id: bb9cda1a4a6e53978071a7b98ebf9affeef47c7d
      ab0aeeea
    • Joe Loser's avatar
      Replace FBString's assume_unreachable with folly::assume_unreachable (#1079) · 20ddb17b
      Joe Loser authored
      Summary:
      - Instead of defining a separate `assume_unreachable` wrapper macro for
        support on different compilers, use the one directly from
        `folly/lang/Assume.h` which is spelled `folly::assume_unreachable`.
      - Since the `assume_unreachable` wrapper in `FBString.h` was the only
        thing using FBString's wrapper around `always_inline` for various
        compilers as well, we can remove that as well.
      Pull Request resolved: https://github.com/facebook/folly/pull/1079
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14605330
      
      Pulled By: Orvid
      
      fbshipit-source-id: ec5529d8913fcec0a7eb03bce006d8fec71d525b
      20ddb17b
    • Dan Melnic's avatar
      Round up microseconds to nearest millisecond value in the default... · 4f8c4177
      Dan Melnic authored
      Round up microseconds to nearest millisecond value in the default TimeoutManager::scheduleTimeoutHighRes implementation
      
      Summary:
      Round up microseconds to nearest millisecond value in the default TimeoutManager::scheduleTimeoutHighRes implementation
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14702027
      
      fbshipit-source-id: b0c710c25c1d9b92ebf28e490507eb3dc3f4db31
      4f8c4177
  2. 01 Apr, 2019 5 commits
    • Joe Loser's avatar
      Cut constexpr function comp objects in ConstexprMath.h (#1020) · 1cb399a3
      Joe Loser authored
      Summary:
      - We have several function objects that define constexpr call operators
        for `operator<`, `operator<=`, etc. These were needed prior to
        C++14 in order for them to be `constexpr`, as vendor implementations did not
        mark them `constexpr`.
      - Since Folly requires C++14, callers who are relying on these should
        migrate to `std::less<T>`, and other function objects in the standard
        library, which are now marked constexpr.
      Pull Request resolved: https://github.com/facebook/folly/pull/1020
      
      Reviewed By: Orvid
      
      Differential Revision: D14612068
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 378e148e6fd8e98cfba529c1e1c1a4d8f71dc8a7
      1cb399a3
    • Joe Loser's avatar
      Deduction guide for fbvector (#1090) · 3a7d1323
      Joe Loser authored
      Summary:
      - Add deduction guide for `fbvector` which is only available if the
        feature test macro for deduction guides is available or if we are on
        MSVC.
      Pull Request resolved: https://github.com/facebook/folly/pull/1090
      
      Reviewed By: nbronson
      
      Differential Revision: D14663586
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: b3db8fc6ee3b13b84bb6a4a49d2a1801dc80fd4a
      3a7d1323
    • Giuseppe Ottaviano's avatar
      Use F14 for Distinct/GroupBy · 1727ca23
      Giuseppe Ottaviano authored
      Reviewed By: yfeldblum, philippv, luciang
      
      Differential Revision: D14713196
      
      fbshipit-source-id: 327f2beb064e61e323edfaf9837bc39275bb8d14
      1727ca23
    • Andrii Grynenko's avatar
      Add a safe ensure() variant for SemiFuture · 66ecb23e
      Andrii Grynenko authored
      Reviewed By: yfeldblum, larabear
      
      Differential Revision: D14692263
      
      fbshipit-source-id: fbdab61363ea83667832dbc56a883d069a1bd597
      66ecb23e
    • Wez Furlong's avatar
      folly: force static boost linkage · 53742745
      Wez Furlong authored
      Summary:
      This mirrors what we use when building thrift.
      Without this, boost somehow picks a mix of static and shared
      libs, but the static linkage doesn't know how to find the libdir
      and thus the link fails.
      
      This bubbles up when building folly's tests, which also require
      linking with glog.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14700315
      
      fbshipit-source-id: a331fdb493e7af62b42833b90bd20367778642ea
      53742745
  3. 30 Mar, 2019 1 commit
    • Wez Furlong's avatar
      folly: fix compilation on windows · 0fa75356
      Wez Furlong authored
      Summary:
      The type is `HANDLE` but is being passed to something that
      wants an `int` for a socket/file descriptor, so let's
      explicitly translate this into a socket descriptor.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14680671
      
      fbshipit-source-id: c7b3f6058ca486dbda01b069ec5d67cc2b3ea478
      0fa75356
  4. 29 Mar, 2019 6 commits
    • Wez Furlong's avatar
      ThriftCppLibrary.cmake: fixup deps · fd2f5d20
      Wez Furlong authored
      Summary:
      this adds the include and library dirs for generated thrift targets;
      these are important when those dependencies are not installed into a default
      prefix.
      
      Reviewed By: strager
      
      Differential Revision: D14683957
      
      fbshipit-source-id: ed47ffac5c8732810afe77e6947584b7a2f05155
      fd2f5d20
    • Wez Furlong's avatar
      folly: cmake: fixup libevent include dirs · 430228fc
      Wez Furlong authored
      Summary:
      When finding a package via its config, we need to
      add its include dirs to our list.  Previously we were squeaking
      by for this because libevent was installed in either the default
      include path or in the same installation prefix as folly.
      
      In the getdeps build environment we have libevent in its own
      installation prefix.
      
      The `LibeventConfig.cmake` file from libevent `release-2.1.8-stable` exports
      the include dirs via the `LIBEVENT_INCLUDE_DIRS` variable, which is slightly
      different from that used by the `folly/public_tld/CMake/FindLibEvent.cmake`
      file.
      
      In a later diff I plan to standardize and move the libevent
      logic to the common cmake dir.  For now, this unblocks my build.
      
      Reviewed By: strager
      
      Differential Revision: D14680677
      
      fbshipit-source-id: 9f757c84fd145d052925803348008dc2c1abf263
      430228fc
    • Kirk Shoop's avatar
      make subset of pushmi build in xplat · df5f9801
      Kirk Shoop authored
      Summary:
      changes needed to add pushmi to xplat which is needed to make folly::Executor depend on pushmi.
      
      split from - D12912583
      
      MSVC 15.6.7 (required to keep cuda working) issues:
      - __VA_ARGS__ results in a single token on MSVC and not on gcc or clang. I changed the macros to expand the single token so that it is parsed as multiuple tokens again
      - some template usage must be placed inside `decltype()` to work with MSVC
      - a nested set of macros using __VA_ARGS__ only worked on MSVC and clang when nested twice, but not when nested three times. changed the macros to use explicit parameters.
      - gave up on pushmi invoke/invoke_result_t, now uses folly:Invoke instead.
      - gave up on property_insert_t, removed usage that was needed for ExecutorTest
      - switched many uses of make_receiver/make_sender to full bespoke receiver/sender implementations.
      - disabled deduction guides on windows
      - disabled apply on windows
      - added additional disambiguity for function overloads that MSVC complained were redefinitions (only differed in SFINAE) also reduced to one `operator|` for this reason
      - restructured `__property_category_t` and `__properties_t` to reduce MSVC ICE and other issues.
      - MSVC did not like `property_set_element<POut, property_category_t<PIn>>` changed to `property_set_element<POut, PCategory>`
      - MSVC complained about implicitly deleted destructors for `property_set_insert` explicitly added them..
      - MSVC does not like `)::value` sequence added `bool_v`.
      - replaced auto with explicit return types in some places.
      - added the missing `remove_cvref_t`
      
      In other news:
      - added tags.h to minimize Executor dependencies on pushmi
      - add `property_set_traits_disable_v` to allow EventBase to disable SequencedExecutor traits specialization
      - add support for building without exceptions to the customization points
      
      Reviewed By: ericniebler
      
      Differential Revision: D14686496
      
      fbshipit-source-id: c3f195783fd9a5f77b997498c44d4eebef1afe57
      df5f9801
    • Andrew Smith's avatar
      Adding coroutine-based generator to folly · 8044c14f
      Andrew Smith authored
      Summary: This diff adds the generator and recursive_generator classes from the cppcoro library to folly.
      
      Reviewed By: lewissbaker
      
      Differential Revision: D13834297
      
      fbshipit-source-id: d27d11c39a35749c168a7c8e53c2819c36083467
      8044c14f
    • Yedidya Feldblum's avatar
      Fix folly/gen/test/ParallelMapTest.cpp under MSVC · 340d437c
      Yedidya Feldblum authored
      Summary:
      [Folly] Fix `folly/gen/test/ParallelMapTest.cpp` under MSVC, which does not appear automatically to deduce `{"str"}` as `std::initializer_list<char const*>`.
      
      Breakage in {D14625210}.
      
      Reviewed By: luciang
      
      Differential Revision: D14663535
      
      fbshipit-source-id: 092786236c6589790f234741e52b3fc045bd2b0e
      340d437c
    • Lewis Baker's avatar
      Make folly::coro::blockingWait() work with all SemiAwaitables · d7f3085a
      Lewis Baker authored
      Summary: This allows using blockingWait() with folly::SemiFuture.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D14658875
      
      fbshipit-source-id: a99505bee3a9947d5fe89760ab495fce5679a0a1
      d7f3085a
  5. 28 Mar, 2019 3 commits
    • Joe Loser's avatar
      Implement erase_if for F14 containers (#1069) · 381a2d39
      Joe Loser authored
      Summary:
      - For each F14 container, implement `erase_if(F14Container&, Predicate)` similar to C++20 `erase_if(std::unordered_map&, Predicate)`.
      - The semantics of `erase_if` are that it erases all elements in the container which satisfy the given predicate.
      Pull Request resolved: https://github.com/facebook/folly/pull/1069
      
      Reviewed By: nbronson
      
      Differential Revision: D14588030
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 87098804b993e9fb742f3a8feed43453aa99c885
      381a2d39
    • Caleb Marchent's avatar
      Add __pychache__ to .gitignore · 379f9548
      Caleb Marchent authored
      Summary:
      When running shell_building, the tree gets littered with __pycache__ files,
      hence ignore them.
      
      Reviewed By: wez
      
      Differential Revision: D14664303
      
      fbshipit-source-id: d41837cdfda1ae93c2d9330f00284128b3f7f7d0
      379f9548
    • Lewis Baker's avatar
      Add support for folly::coro::Task<T&> · 13560466
      Lewis Baker authored
      Summary:
      Extended `folly::coro::Task` to support an lvalue-reference value type.
      
      A `Task<T&>` stores the value internally in a `folly::Try<std::reference_wrapper<T>>` as `folly::Try` does not support reference value types. This means that when you use `co_await task.co_awaitTry()` on a `Task<T&>` that you get back a `folly::Try<std::reference_wrapper<T>>` instead of a `folly::Try<T&>`.
      
      Also added support for using `.co_awaitTry()` on `Task<T>`.
      Previously the `.co_awaitTry()` method was only supported on the `TaskWithExecutor<T>` type.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D14657997
      
      fbshipit-source-id: a168991b5a9c278dcc2387a6ff4fba9e47ccac0d
      13560466
  6. 27 Mar, 2019 10 commits
    • Dan Melnic's avatar
      Fix for the HHWheelTimer broken Windows build · f5977149
      Dan Melnic authored
      Summary:
      Fix for the HHWheelTimer broken Windows build
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14642461
      
      fbshipit-source-id: 07292429b1e27eafeb144ab529940aee86dcca6d
      f5977149
    • David Lam's avatar
      Fix some typos in folly/io/IOBuf.h documentation · 047526d5
      David Lam authored
      Summary: As title.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14638826
      
      fbshipit-source-id: 1904a1e416f299c2cafc147a3eb15dad325ae240
      047526d5
    • Caleb Marchent's avatar
      Allow LogDevice to build without Submodules (#71) · a8422464
      Caleb Marchent authored
      Summary:
      As a step in the plan to migrate LogDevice to using fbcode_builder as
      the primary build method, allow LogDevice to build without submodules.
      In place of the self compiled modules, the CMake scripts will look in
      the system (or provided prefix locations) and use precompiled modules
      there. Users can then use fbcode_builder to ensure those required
      modules are built and available.
      
      * Use new 'folly_test_util' library rather than referencing sources
      directly
      Pull Request resolved: https://github.com/facebookincubator/LogDevice/pull/71
      
      Reviewed By: AhmedSoliman
      
      Differential Revision: D14578119
      
      Pulled By: calebmarchent
      
      fbshipit-source-id: 36400d41d3f1906919706d20d0fb53195fec2e63
      a8422464
    • Qi Wang's avatar
      Avoid allocation from the hugepage allocator alloc_hook. · 546a879d
      Qi Wang authored
      Summary:
      The alloc_hook is invoked on the malloc path. Therefore we should not
      allocate on this path.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14605677
      
      fbshipit-source-id: f95b9ff3e14f65781045d26ce59ec008c113ca81
      546a879d
    • Yedidya Feldblum's avatar
      Back out D14608368 to HHWheelTimerBase · c0980078
      Yedidya Feldblum authored
      Summary:
      Back out D14608368 "HHWheelTimerBase: use different DEFAULT_TICK_INTERVAL values for milliseconds and microseconds".
      
      The change being backed out breaks the MSVC build; backing it out should restore the MSVC build.
      
      Fixes #1087.
      
      Differential Revision: D14638652
      
      fbshipit-source-id: b06b2934771adeff7a49c54b33da84a5bc973e66
      c0980078
    • Kirk Shoop's avatar
      fix real-concepts builds · 24e531f7
      Kirk Shoop authored
      Summary: removed constraints that are no longer valid.
      
      Reviewed By: ericniebler
      
      Differential Revision: D14606943
      
      fbshipit-source-id: bf7acb88e3b6202caaa3e1333d88e5c516eb18e3
      24e531f7
    • Tom Jackson's avatar
      Make pmap() handle exceptions instead of FATALing · 88ba2915
      Tom Jackson authored
      Summary:
      This switches the output queue from `Output` to `Expected<Output, std::exception_wrapper>`, allowing exceptions to be produced by the predicate. Prior to this change, any exceptions would FATAL, taking down the whole process.
      
      Benchmarks appear unaffected. Memory use will be very similar: Small objects are already padded out to a cache line, so the increase in size will often be zero.
      
      Reviewed By: luciang
      
      Differential Revision: D14625210
      
      fbshipit-source-id: 9bfa1197b7d2285bbc7e42e829beeb3525b3bd44
      88ba2915
    • Tom Jackson's avatar
      Guard is broken · 848e0fa0
      Tom Jackson authored
      Summary: Adding note and disabled test for now, will come back to fixing or killing this later.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14625209
      
      fbshipit-source-id: 6e4f523c02e28fa6080da16485cba68ee78ffc80
      848e0fa0
    • Fred Emmott's avatar
      Revert D13966702: [fbcode] AsyncServerSocket::AcceptCallback::connectionAccepted to NetworkSocket · d58678d6
      Fred Emmott authored
      Differential Revision:
      D13966702
      
      Original commit changeset: 415622dc347d
      
      fbshipit-source-id: 11ff9cac08174cfaefe20e7e4c5e08dc005aaa39
      d58678d6
    • Wez Furlong's avatar
      folly: remove problematic -Wnon-virtual-dtor error from cmake build · 9688659c
      Wez Furlong authored
      Summary:
      This causes problems with the cmake build because boost
      triggers this warning, and we're promoting this to an error.
      
      It is possible to use `-isystem` to tell the compiler that the
      the boost headers are system headers, but introducing that for
      boost headers is a mess.
      
      We can safely live without this warning in the open source build
      as our buck based builds have this enabled correctly.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14631786
      
      fbshipit-source-id: cf30d0921ce592f410c2ad4bfddba1bddef01ed7
      9688659c
  7. 26 Mar, 2019 5 commits
    • Dan Melnic's avatar
      HHWheelTimerBase: use different DEFAULT_TICK_INTERVAL values for milliseconds and microseconds · bc269446
      Dan Melnic authored
      Summary: HHWheelTimerBase: use different DEFAULT_TICK_INTERVAL values for milliseconds and microseconds
      
      Reviewed By: djwatson
      
      Differential Revision: D14608368
      
      fbshipit-source-id: 81ca30dead56e0ec954fce05c9f920e15dc20405
      bc269446
    • Joe Loser's avatar
      Fix Clang 8 -Wdefaulted-function-deleted errors (#1082) · 0029def9
      Joe Loser authored
      Summary:
      - Clang 8 introduces a new compiler option which is turned on by
        default: `-Wdefaulted-function-deleted`.
      - This flags some code which has special member functions which we
        declare as defaulted, but are implicitly deleted. As such, it is a bit
        misleading to mark them as defaulted. So, mark them as deleted. We
        could also remove them and they would be implicitly deleted, but then
        the internal linter would not like that we define a user defined type
        but are not explicit about deleting or defaulting all special member
        functions.
      
      Note:
      - This fixes some Clang 8 compilation issues, but
        https://github.com/facebook/folly/issues/1081 contains details about the
        remaining issues.
      Pull Request resolved: https://github.com/facebook/folly/pull/1082
      
      Reviewed By: Orvid
      
      Differential Revision: D14613574
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 8011b3bc456bf92bbaf374c045fffb130e26d38b
      0029def9
    • Orvid King's avatar
      AsyncServerSocket::AcceptCallback::connectionAccepted to NetworkSocket · 6b559d40
      Orvid King authored
      Summary: This is a largely automated codemod that shifts `folly::AsyncServerSocket::AcceptCallback::connectionAccepted` to taking a `NetworkSocket` rather than a file descriptor. This needs to be done as a single atomic change to avoid breaking things.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13966702
      
      fbshipit-source-id: 415622dc347de53368c404dfbe9a2deae5b75e18
      6b559d40
    • Joe Loser's avatar
      Use feature test macro for deduction guide in Replaceable.h (#1065) · b9a450ef
      Joe Loser authored
      Summary:
      - Replace a check for deduction guide support to use a feature test macro
        for deduction guides rather than a check using `__cplusplus` directive.
      - The existing check using the `__cplusplus` directive is not correct
        for GCC 5.1. With GCC 5.1, `__cplusplus > 201402L` will be true, but the check
        for `#if __cpp_deduction_guides >= 201703` will be false. So, it is
        not valid to just rely on the `__cplusplus` directive to infer
        deduction guide support.
      - We extend the check to use the feature test macro except in the case
        of MSVC, which we infer the feature is supported. MSVC does not define
        feature test macros, despite having implemented the feature.
      Pull Request resolved: https://github.com/facebook/folly/pull/1065
      
      Reviewed By: aary
      
      Differential Revision: D14518809
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: a976ae527ef986ae6d3fc52c316af9bf8e209767
      b9a450ef
    • Yedidya Feldblum's avatar
      Cut FOLLY_CACHE_LINE_SIZE · d1ef780f
      Yedidya Feldblum authored
      Summary:
      [Folly] Cut `FOLLY_CACHE_LINE_SIZE` macro, replacing uses with `folly::hardware_destructive_interference_size`.
      
      As one oddity, `FOLLY_CACHE_LINE_SIZE` had value 64 while `folly::hardware_destructive_interference_size` has value 128, so some types may get larger.
      
      Reviewed By: aary
      
      Differential Revision: D14574695
      
      fbshipit-source-id: 7c5b9e313c5dcdecfec3cc47ec7bd55d08ae762c
      d1ef780f