1. 22 Feb, 2020 2 commits
  2. 21 Feb, 2020 2 commits
  3. 20 Feb, 2020 2 commits
    • Dan Melnic's avatar
      Use sdallocx for IOBuf::releaseStorage · 7ec006ed
      Dan Melnic authored
      Summary: Use sdallocx for IOBuf::releaseStorage
      
      Reviewed By: marksantaniello
      
      Differential Revision: D19925485
      
      fbshipit-source-id: 142276fb64e570e10bfd0b6e22d8c83b204d1c2b
      7ec006ed
    • Dan Melnic's avatar
      Add FOLLY_CLANG_DISABLE_WARNING for Unistd.h · 12c92eaa
      Dan Melnic authored
      Summary:
      Add FOLLY_CLANG_DISABLE_WARNING for Unistd.h
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19652177
      
      fbshipit-source-id: 1fcc3bb65c3b0d73870e599f9fc0463c6836cf9b
      12c92eaa
  4. 19 Feb, 2020 5 commits
    • Chad Austin's avatar
      enable lz4 in the getdeps build of rocksdb · 6156dc3d
      Chad Austin authored
      Summary:
      The Buck build of RocksDB supports LZ4, so if an Eden instance's
      object cache ends up compressed with LZ4 compression, the opensource
      getdeps build cannot open it. Enable LZ4 in the open source getdeps
      build of rocksdb.
      
      Reviewed By: pkaush
      
      Differential Revision: D19961878
      
      fbshipit-source-id: 9a4f37e12bd2b40a0c5dcf2dd1684876886fae26
      6156dc3d
    • TJ Yin's avatar
      Replace folly::Optional::clear() by reset() · 95c7d18c
      TJ Yin authored
      Reviewed By: yfeldblum
      
      Differential Revision: D19953637
      
      fbshipit-source-id: c2135fc24084b7bba0c9d6fc978c8b6c8f9943d4
      95c7d18c
    • Ter Chrng Ng's avatar
      Revert D19848850: Add missing libraries back to ovrsource · 19f6ae0d
      Ter Chrng Ng authored
      Differential Revision:
      D19848850
      
      Original commit changeset: 21e61529d8b9
      
      fbshipit-source-id: c490eb0024a4cda830389a359ee2631615345f2d
      19f6ae0d
    • Nick Cooper's avatar
      Improve blockingWait test · f29e87cf
      Nick Cooper authored
      Summary: Previously if the loop simply failed to execute the test could pass, add some minor changes to ensure control flow is as required.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D19960864
      
      fbshipit-source-id: 5a437d9e7d3b7c249cbf999fe7ea5eecfe668658
      f29e87cf
    • Andrew Gallagher's avatar
      Add some missing includes · 0d305cb1
      Andrew Gallagher authored
      Summary: Missing includes which break modular builds.
      
      Reviewed By: igorsugak, luciang
      
      Differential Revision: D19738860
      
      fbshipit-source-id: 97a0329f3e558309ca87f4dd7be8dd96e9ba09a8
      0d305cb1
  5. 18 Feb, 2020 3 commits
    • Nick Cooper's avatar
      folly::coro::blockingWait should gracefully handle cases with thrown exceptions · 19910c37
      Nick Cooper authored
      Summary:
      If the waited upon object throws an exception when blockingWait is called within a fiber context this can cause a SIGABT as it is not permissible to yield (due to the inner baton) in an exception context.
      
      To fix this, instead capture the exception and permit destruction to occur outside of exception handling.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D19951124
      
      fbshipit-source-id: cf1bf9a62557147863390132f551d08e20c02c2d
      19910c37
    • Ter Chrng Ng's avatar
      Add missing libraries back to ovrsource · c9e346af
      Ter Chrng Ng authored
      Summary: It was originally disabled to let test pass in ovrsource, they are now passing, enabling them back
      
      Reviewed By: pranjalssh
      
      Differential Revision: D19848850
      
      fbshipit-source-id: 21e61529d8b9f519b4c8cbf4787c8e3f28b99bb1
      c9e346af
    • Dan Melnic's avatar
      Add folly::sizedFree · 8bc1252f
      Dan Melnic authored
      Summary:
      Add folly::sizedFree
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: ot
      
      Differential Revision: D19944311
      
      fbshipit-source-id: b5b1a648a180662fe838237c3c3b153e42fe0617
      8bc1252f
  6. 16 Feb, 2020 1 commit
    • Orvid King's avatar
      Support u8 as char8_t in StringPiece literals · cae89fc3
      Orvid King authored
      Summary: In C++20, u8 prefixed strings are typed as `char8_t` not `char`, so we need to support that in `StringPiece`.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19822967
      
      fbshipit-source-id: c3441ba718b40f0781766d4a80c3432b4514a35c
      cae89fc3
  7. 15 Feb, 2020 1 commit
  8. 14 Feb, 2020 6 commits
    • Shai Szulanski's avatar
      Add coro::toSemiFuture · 64fc8458
      Shai Szulanski authored
      Summary:
      Currently the best way to get an eager SemiFuture from an AsyncGenerator is
        folly::coro::co_invoke(
            [&]()
                -> folly::coro::Task<folly::coro::AsyncGenerator<T&&>::NextResult> {
              co_return co_await gen.next();
            })
            .scheduleOn(&ex)
            .start();
      which is very verbose. This diff adds helpers to make this a simple function call.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D19835473
      
      fbshipit-source-id: f6e7e72cad0e0596df375d2662c87d4412536c03
      64fc8458
    • Zhengxu Chen's avatar
      Make thrift metadata available across fbcode oss builds. · 0b5752df
      Zhengxu Chen authored
      Summary: There are downstream oss builds showing build failure caused by introduction of metadata. We want to make them proceed to build so we won't get errors in CI.
      
      Reviewed By: iahs
      
      Differential Revision: D19900007
      
      fbshipit-source-id: 4201448f7980b53e407fd2bc1c74ed4ffa8e18c1
      0b5752df
    • Nathan Bronson's avatar
      fix missing eraseInto overload for key with permissive constructor · 6aa06e7f
      Nathan Bronson authored
      Summary:
      If a key type has a templated constructor that can implicitly
      accept const_iterator, then a call to erase or eraseInto with a non-const
      iterator results in an ambiguous overload. This diff adds an extra
      overload of eraseInto to avoid the ambiguity, as well as adding unit
      tests that cover the rare corner case.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19809069
      
      fbshipit-source-id: 499849da2d6ad64070b13eb0a9ed86a3d49ad9b0
      6aa06e7f
    • Nathan Bronson's avatar
      add eraseInto to F14 maps · 10abef97
      Nathan Bronson authored
      Summary:
      It's useful to be able to move the key and value
      out of a hash table as that entry is being erased. Since
      std::unordered_map's extract API isn't implementable for hash tables
      that perform bulk allocation, we expose similar functionality via
      F14{Fast,Value,Vector,Node}Map::eraseInto.  eraseInto gives a key_type&&
      and mapped_type&& to the specified callback, allowing it to move them
      elsewhere before the underlying value_type is destroyed.
      
      The keen observer will note that there is no way to move the key out
      of a std::pair<key_type const,mapped_type> without relying on undefined
      behavior. We already rely on this form of UB to avoid copying keys during
      rehash, and perform it only when we have total control over the lifecycle
      of the object and the memory backing the value_type.
      
      eraseInto was previously implemented for F14 sets.
      
      Reviewed By: shixiao
      
      Differential Revision: D19777644
      
      fbshipit-source-id: 9904224af2c6e51abeadae62cc5e66f7bf4b1ae7
      10abef97
    • Orvid King's avatar
      Another fix for newer Windows SDK · 7d2114a5
      Orvid King authored
      Summary: This issue was only showing up in a single test, but include orders meant that stdio.h could end up being included in a way that caused it to not properly define the normal names it's supposed to, as they were getting disabled due to the `_CRT_INTERNAL_NON_STDC_NAMES` changes being made.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19866950
      
      fbshipit-source-id: 9d6391f5c0e5a2ef44f0f8ba6dad064cfecf0a82
      7d2114a5
    • Orvid King's avatar
      Support newer versions of boost in the portable PThread implementation · 52dcff2e
      Orvid King authored
      Summary: Newer versions of boost thread re-wrote how this works, so use the new way.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19824658
      
      fbshipit-source-id: a3d66fd6ef781ac83c92f6313cf47a7920cfebda
      52dcff2e
  9. 13 Feb, 2020 5 commits
  10. 12 Feb, 2020 4 commits
    • Joseph Wu's avatar
      Fix missing re2 dep in opensource · f3957689
      Joseph Wu authored
      Summary: platform_mapping library needs RE2 lib.
      
      Reviewed By: shri-khare
      
      Differential Revision: D19838529
      
      fbshipit-source-id: 71a2c06437ce05a42396a2867ddadb029e36926e
      f3957689
    • Dan Melnic's avatar
      Remove trivial-copyability req from LockFreeRingBuffer · bcaf9cdf
      Dan Melnic authored
      Summary: [Folly] Remove trivial-copyability requirement from `LockFreeRingBuffer` since we can rely on the compiler to optimize copy operations over types which are trivially-copyable without our code having to specify `memcpy`.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19844612
      
      fbshipit-source-id: 4770e46ac8c63fa68b68598fb5012cb58896f550
      bcaf9cdf
    • Yedidya Feldblum's avatar
      Use SingletonThreadLocal for the current fiber manager · 7ce27feb
      Yedidya Feldblum authored
      Summary: [Folly] Use SingletonThreadLocal for the current fiber manager, which does not depend on whether `__thread` or `thread_local` is available.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D19229511
      
      fbshipit-source-id: a92016aca89205c2842dc4f71054b1b6306b14b9
      7ce27feb
    • Yedidya Feldblum's avatar
      Prefer invoke_result_t in DistributedMutex · 5bdf434f
      Yedidya Feldblum authored
      Summary: [Folly] Prefer `invoke_result_t` in `DistributedMutex` over the underlying `decltype` and `declval` implementation.
      
      Reviewed By: aary
      
      Differential Revision: D19321643
      
      fbshipit-source-id: 323a0fce49447d2f009ad3bc61e285de3f311ff1
      5bdf434f
  11. 11 Feb, 2020 4 commits
    • Yedidya Feldblum's avatar
      Use invocability helper variables · 59e20c74
      Yedidya Feldblum authored
      Summary: [Folly] Use invocability helper variables in preference to types.
      
      Reviewed By: aary
      
      Differential Revision: D18748026
      
      fbshipit-source-id: e7a76c1238360c55dd6d41c53f763e9df4069acb
      59e20c74
    • Ming Yi Teo's avatar
      Enable -Wshorten-64-to-32 in wangle · 0ea41166
      Ming Yi Teo authored
      Summary:
      1. Add `"-Wshorten-64-to-32"` to `_extra_clang_flags`
      2. Fix warnings generated from `buck build --keep-going wangle/...`
      
      Reviewed By: chadaustin
      
      Differential Revision: D19647345
      
      fbshipit-source-id: 417840fe82ed3d5c9c2d989a0acf67e12758c1f9
      0ea41166
    • Christoph Purrer's avatar
      Fix <folly/portability/Windows.h> on Windows SDK 1903 / 10.0.18362.0 · ed9408bf
      Christoph Purrer authored
      Summary:
      Folly does not compile with Windows SDK 1903. The issues is in folly/portability/Windows.h and surfaces when compiling files including it, e.g.: xplat/folly.portability/Stdlib.cpp
      ```
      xplat\folly/portability/SysStat.h:47:5: error: conflicting types for 'mkdir'
      int mkdir(const char* fn, int mode);
          ^
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\direct.h:111:26: note: previous declaration is here
          _ACRTIMP int __cdecl mkdir(
                               ^
      xplat\folly\portability\Stdlib.cpp:47:11: error: no matching function for call to 'mkdir'
          ret = mkdir(ptr, 0700);
                ^~~~~
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\direct.h:111:26: note: candidate function not viable:
            requires single argument '_Path', but 2 arguments were provided
          _ACRTIMP int __cdecl mkdir(
                               ^
      2 errors generated.
      ```
      Now internal Windows functions collide with folly portability ones defined in https://github.com/facebook/folly/blob/master/folly/portability/Unistd.h#L61-L93
      
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\direct.h defines a Windows ```mkdir``` function when
      ```
      #if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES
      //...
          _Check_return_ _CRT_NONSTDC_DEPRECATE(_mkdir)
          _ACRTIMP int __cdecl mkdir(
              _In_z_ char const* _Path
              );
      
          _Check_return_ _CRT_NONSTDC_DEPRECATE(_rmdir)
          _ACRTIMP int __cdecl rmdir(
              _In_z_ char const* _Path
              );
      
      #endif // _CRT_INTERNAL_NONSTDC_NAMES
      ```
      
      When diffing the current Windows SDK 1903 version: C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h
      with a previous one, e.g.: 1809 C:\tools\toolchains\vs2017_15.9\WindowsSdk\Include\10.0.17763.0\ucrt\corecrt.h
      we see a fundamental change:
      
      ## SDK 1903
      ```
      #if ( defined _CRT_DECLARE_NONSTDC_NAMES && _CRT_DECLARE_NONSTDC_NAMES) || \
          (!defined _CRT_DECLARE_NONSTDC_NAMES && !__STDC__                 )
          #define _CRT_INTERNAL_NONSTDC_NAMES 1
      #else
          #define _CRT_INTERNAL_NONSTDC_NAMES 0
      #endif
      ```
      
      ## SDK 1809
      ```
      #define _CRT_INTERNAL_NONSTDC_NAMES                                            \
          (                                                                          \
              ( defined _CRT_DECLARE_NONSTDC_NAMES && _CRT_DECLARE_NONSTDC_NAMES) || \
              (!defined _CRT_DECLARE_NONSTDC_NAMES && !__STDC__                 )    \
          )
      ```
      
      Reviewed By: Orvid
      
      Differential Revision: D19804183
      
      fbshipit-source-id: cbbe32c611a3c011175145329c29de4a9597868c
      ed9408bf
    • Yedidya Feldblum's avatar
      Adjust allocator ctors · 5ee564ba
      Yedidya Feldblum authored
      Summary:
      [Folly] Adjust allocator ctors.
      
      * Add missing family ctor to `SysAllocator` to bring it into better alignment with generic C++ allocator expectations.
      * Make other family ctors implicit.
      * Ensure that the actual copy ctors take precedence.
      * Hide copy assignment operators.
      
      Reviewed By: marksantaniello
      
      Differential Revision: D19817836
      
      fbshipit-source-id: de90fdd7cae36ac178a89556e63a29f4014532a1
      5ee564ba
  12. 10 Feb, 2020 5 commits
    • Shai Szulanski's avatar
      Add coro::AsyncPipe · 552c07c3
      Shai Szulanski authored
      Summary: we've seen people using `apache::thrift::Stream` as a heavyweight way to produce this functionality. As we move to delete that we want to provide an alternative using `AsyncGenerator`.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D19774841
      
      fbshipit-source-id: 5ebaa0afcb08f04d7fb899b34ac7dc0270186852
      552c07c3
    • Shai Szulanski's avatar
      Add coro::UnboundedQueue · 5000a12b
      Shai Szulanski authored
      Summary: we've seen people using `apache::thrift::Stream` as a heavyweight way to produce this functionality. As we move to delete that we want to provide an alternative using `AsyncGenerator`.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D19726875
      
      fbshipit-source-id: 047e1db4b429883a69af9819e0c6ad04022ef91f
      5000a12b
    • Matt Ma's avatar
      Support debug_ranges lookup when matching address for inline functions. · 416bc6ef
      Matt Ma authored
      Summary:
      Range lists are contained in a separate object file section called .debug_ranges. A range list is
      indicated by a DW_AT_ranges attribute whose value is represented as an offset from the
      beginning of the .debug_ranges section to the beginning of the range list.
      Each entry in a range list is either:
      a range list entry,
      a base address selection entry, or
      an end of list entry.
      
      Reviewed By: luciang
      
      Differential Revision: D19658819
      
      fbshipit-source-id: ed70915465f0ac6bb8ab6f7efe415a3d8c5b04ee
      416bc6ef
    • Matt Ma's avatar
      Get the correct file name for inline functions. · 4c872d1c
      Matt Ma authored
      Summary:
      Here is an example for class inline member function declared and defined in the same file:
      
      ```
      Definition:
      0x00004c0a:           DW_TAG_subprogram [55] *
                              DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x00177124] = "_ZNK5folly10symbolizer4test24ClassWithInlineFunctions9inlineBarERNS0_10FrameArrayILm100EEE")
                              DW_AT_name [DW_FORM_strp] ( .debug_str[0x00089a73] = "inlineBar")
                              DW_AT_decl_file [DW_FORM_data1] (0x1a)
                              DW_AT_decl_line [DW_FORM_data1] (0xa5)
                              DW_AT_declaration [DW_FORM_flag_present]  (true)
                              DW_AT_external [DW_FORM_flag_present] (true)
                              DW_AT_accessibility [DW_FORM_data1] (0x01)
      …
      
      Declaration:   -- no DW_AT_decl_file
      0x000164c1:   DW_TAG_subprogram [228] *
                      DW_AT_specification [DW_FORM_ref4]  (cu + 0x48ea => {0x00004c0a})
                      DW_AT_inline [DW_FORM_data1]  (0x01)
                      DW_AT_object_pointer [DW_FORM_ref4] (cu + 0x161ac => {0x000164cc})
      
      …
      
      Inline function call
      0x0001657b:     DW_TAG_inlined_subroutine [140] *
                        DW_AT_abstract_origin [DW_FORM_ref4]  (cu + 0x161a1 => {0x000164c1})
                        DW_AT_low_pc [DW_FORM_addr] (0x000000000040fa6e)
                        DW_AT_high_pc [DW_FORM_data4] (0x00000055)
                        DW_AT_call_file [DW_FORM_data1] (0x1a)
                        DW_AT_call_line [DW_FORM_data1] (0xe2)
      ```
      
      Here is an example for class inline member function declared and defined in different files:
      
      ```
      Definition:  DW_AT_decl_file: 0x01  --> SymbolizerTestUtils.h
      0x00004c3d:           DW_TAG_subprogram [55] *
                              DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x0017717f] = "_ZNK5folly10symbolizer4test22InlineFunctionsWrapper9inlineBarERNS0_10FrameArrayILm100EEE")
                              DW_AT_name [DW_FORM_strp] ( .debug_str[0x00089a73] = "inlineBar")
                              DW_AT_decl_file [DW_FORM_data1] (0x01)
                              DW_AT_decl_line [DW_FORM_data1] (0x30)
                              DW_AT_declaration [DW_FORM_flag_present]  (true)
                              DW_AT_external [DW_FORM_flag_present] (true)
                              DW_AT_accessibility [DW_FORM_data1] (0x01)
      
      …
      
      Declaration:   DW_AT_decl_file: 0xbf  --> SymbolizerTestUtils-inl.h
      0x00017ee8:   DW_TAG_subprogram [231] *
                      DW_AT_decl_file [DW_FORM_data1] (0xbf)
                      DW_AT_decl_line [DW_FORM_data1] (0x21)
                      DW_AT_specification [DW_FORM_ref4]  (cu + 0x491d => {0x00004c3d})
                      DW_AT_inline [DW_FORM_data1]  (0x01)
                      DW_AT_object_pointer [DW_FORM_ref4] (cu + 0x17bd5 => {0x00017ef5})
      
      …
      
      Inline function call
      0x00017fa5:     DW_TAG_inlined_subroutine [158] *
                        DW_AT_abstract_origin [DW_FORM_ref4]  (cu + 0x17bc8 => {0x00017ee8})
                        DW_AT_low_pc [DW_FORM_addr] (0x00000000004104ee)
                        DW_AT_high_pc [DW_FORM_data4] (0x00000055)
                        DW_AT_call_file [DW_FORM_data1] (0x1a)
                        DW_AT_call_line [DW_FORM_data2] (0x0101)
      ```
      
      Reviewed By: luciang
      
      Differential Revision: D19658560
      
      fbshipit-source-id: 78c1e42d76c19f09e4632c40e0df18bfb49479f9
      4c872d1c
    • Matt Ma's avatar
      Prefer linkage name to name for inline function frames. · 5f30664e
      Matt Ma authored
      Summary: Linkage name (DW_AT_linkage_name) contains more information than the identifier name (DW_AT_name).
      
      Reviewed By: luciang
      
      Differential Revision: D19657767
      
      fbshipit-source-id: 87b2293e6f723ceb8b5202db0f3c569c37c6c7ea
      5f30664e