1. 03 Jan, 2020 10 commits
    • Ján's avatar
      disable peer name check (D18162775) when OpenSSL is too old · b6a14167
      Ján authored
      Summary: D18162775 added this code, which doesn't compile on OpenSSL 1.0.1 (e.g. on Debian 8, which is still supported).
      
      Differential Revision: D19032946
      
      fbshipit-source-id: 0f005186e4c9dbaaa76ffce2b62150d92135801b
      b6a14167
    • Songqiao Su's avatar
      (folly) fix memory leak in folly::Observer addCallback · b77eab92
      Songqiao Su authored
      Summary: shared_ptr cycle triggered by inconsistent destructor/move constructor
      
      Reviewed By: yfeldblum, andriigrynenko
      
      Differential Revision: D19206912
      
      fbshipit-source-id: 2b5dcf639eb2e8f9d4ade9511cd9093d7565d482
      b77eab92
    • Dan Melnic's avatar
      Add a BackendCb callback to support multiple types of backend operations (not limited to poll) · fec15c23
      Dan Melnic authored
      Summary: Add a BackendCb callback to support multiple types of backend operations (not limited to poll)
      
      Reviewed By: danobi
      
      Differential Revision: D19275105
      
      fbshipit-source-id: 2eba28b429da4bc237e9c2c2a7e5d0505bd20961
      fec15c23
    • Maged Michael's avatar
      hazptr: Add singleton CPUThreadPoolExecutor for default domain asynchronous reclamation · d895d4ba
      Maged Michael authored
      Summary: Add function to make the default hazptr domain use a CPUThreadPoolExecutor.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D19107084
      
      fbshipit-source-id: 873779d7b9314e5920f2542ef23bb707b47a4e10
      d895d4ba
    • Maged Michael's avatar
      ConcurrentHashMap: Make size_ data-race-free · 70953110
      Maged Michael authored
      Summary: Eliminate data race reported in https://github.com/facebook/folly/issues/1280
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D19072137
      
      fbshipit-source-id: ca2431b8b3b6114694f25024cac0cc0433acfe8b
      70953110
    • Rosen Penev's avatar
      pass by value (#1299) · bfb98fab
      Rosen Penev authored
      Summary:
      Found with modernize-pass-by-value
      Signed-off-by: default avatarRosen Penev <rosenp@gmail.com>
      Pull Request resolved: https://github.com/facebook/folly/pull/1299
      
      Differential Revision: D19270977
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 77c33a3425376838fa3c7b04b166137eb74f63ba
      bfb98fab
    • Maged Michael's avatar
      hazptr: Use executor for default domain asynchronous reclamation · 78cfa5e5
      Maged Michael authored
      Summary:
      Add support for using an executor for asynchronous reclamation.
      
      This enables doing asynchronous reclamation on a dedicated executor, which serves two purposes:
      (1) Avoid unpredictable latencies for regular thread operations (that happen to trigger synchronous reclamation).
      (2) Avoid deadlock that may arise from regular threads running deleters that may require resources held by such threads.
      
      By default the QueuedImmediateExecutor is used.
      A member function set_executor allows the use of different executors.
      The intent is to use a thread pool executor.
      In order to avoid cyclical dependency, subsequent diffs (1) add in a separate library a function make the default hazptr domain use a thread pool executor and (2) add a call to such function to folly/init.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D19107049
      
      fbshipit-source-id: 540e9d3aea786a8ece7958d6c09b9429e2a2f4a5
      78cfa5e5
    • Yedidya Feldblum's avatar
      Ensure global inits in Random are static-safe · 66a8324a
      Yedidya Feldblum authored
      Summary:
      [Folly] Ensure global inits in Random are static-safe by using the machinery of `static` local variables.
      
      The default mutex type used with `once_flag` is `SharedMutex`, but that mutex type is not trivially-destructible. An alternative mutex type might be trivially-destructible, such as `MicroLock`, so an alternative solution could be to use `once_flag` with `MicroLock`.
      
      Reviewed By: ot, luciang
      
      Differential Revision: D19207285
      
      fbshipit-source-id: a7d817cf8521337543e3e27bc0e0e61241714ced
      66a8324a
    • Maged Michael's avatar
      RequestContext: Declare gflag, add folly_ prefix to gflag name · ba225d4b
      Maged Michael authored
      Summary:
      Declare gflag to enable turning it on and off at run time.
      Added folly_ prefix to gflag name to reduce name pollution.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D19144459
      
      fbshipit-source-id: 1e82cb102e47fea856952d1e630c03baf38adf1d
      ba225d4b
    • Yedidya Feldblum's avatar
      FOLLY_SAFE_PCHECK · 09634ef5
      Yedidya Feldblum authored
      Summary: [Folly] `FOLLY_SAFE_PCHECK`, for reporting errors from C standard library functions which may set errno from within code which must be reentrant.
      
      Reviewed By: nbronson
      
      Differential Revision: D19222785
      
      fbshipit-source-id: 532ccee39c9d180b9b17edbd31517c09024539d7
      09634ef5
  2. 02 Jan, 2020 3 commits
    • Yedidya Feldblum's avatar
      Avoid unnecessary virtualization in MemoryMapping · 1cd1bfb6
      Yedidya Feldblum authored
      Summary: [Folly] Avoid unnecessary virtualization in `MemoryMapping`.
      
      Reviewed By: Orvid
      
      Differential Revision: D19261862
      
      fbshipit-source-id: 520f1182477bc723c8f42505b30fc09e00758d05
      1cd1bfb6
    • Lukas Piatkowski's avatar
      rust-shed: move stats to the shed · 99642ef2
      Lukas Piatkowski authored
      Summary: This change also introduces a dummy no-op stats implementation for non-fbcode builds.
      
      Reviewed By: farnz
      
      Differential Revision: D19193954
      
      fbshipit-source-id: f513368a2387987bf129ddf935217c90b7c84f2a
      99642ef2
    • James Donald's avatar
      Make defined(_MSC_VER) checks consistent for -Wundef · 96c62e34
      James Donald authored
      Summary: Note: also making the `__GNUC__ || __clang__` nearby part in Pretty.h the same so that the header doesn't appear inconsistent, likewise for Hardware.h
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19237732
      
      fbshipit-source-id: bf3270ddf2102ea722be1eb1a557234d264f9af7
      96c62e34
  3. 01 Jan, 2020 2 commits
  4. 31 Dec, 2019 2 commits
  5. 30 Dec, 2019 1 commit
  6. 29 Dec, 2019 2 commits
    • Yedidya Feldblum's avatar
      Apply clang-format in places · 96652b6f
      Yedidya Feldblum authored
      Summary: [Folly] Apply `clang-format` in places.
      
      Reviewed By: markisaa
      
      Differential Revision: D19249033
      
      fbshipit-source-id: 1a768eea013112ee5cd9d8b78114927fd6d6db04
      96652b6f
    • Yedidya Feldblum's avatar
      Apply python formatting to unsynced .pyi files · 88065016
      Yedidya Feldblum authored
      Summary: [Folly] Apply python formatting to a few unsynced places in some `.pyi` files.
      
      Reviewed By: markisaa
      
      Differential Revision: D19249037
      
      fbshipit-source-id: 6b14c5fedbee0f25a4b0fdfdd0f157e62a95a766
      88065016
  7. 28 Dec, 2019 3 commits
  8. 26 Dec, 2019 2 commits
    • Igor Sugak's avatar
      add unsigned-integer-overflow suppressions to Hash.h · a40d6083
      Igor Sugak authored
      Summary:
      I'd like to enable UBSAN's unsigned-integer-overflow check. It's not an undefined behavior, but it is often unintentional.
      
      This adds suppressions to folly/hash where unsigned-integer-overflow is expected due the the nature of operations.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19217819
      
      fbshipit-source-id: 1a468018823e0ac1d01c3ae889e38e9d42bdd8b7
      a40d6083
    • Yedidya Feldblum's avatar
      Cut some outdated lines in docs and comments · c895f607
      Yedidya Feldblum authored
      Summary: [Folly] Cut some outdated lines in docs and comments which refer to no-longer supported versions of gcc.
      
      Reviewed By: Orvid
      
      Differential Revision: D19229059
      
      fbshipit-source-id: c8abb81c292091339622e9cc3d4e5fd3cd6459b4
      c895f607
  9. 25 Dec, 2019 6 commits
    • Rosen Penev's avatar
      constexpr: Use GLIBCXX instead of GNUC (#1288) · 1702a53f
      Rosen Penev authored
      Summary:
      libcxx does not have strcmp or strlen as constexpr.
      Signed-off-by: default avatarRosen Penev <rosenp@gmail.com>
      Pull Request resolved: https://github.com/facebook/folly/pull/1288
      
      Reviewed By: Orvid
      
      Differential Revision: D19226813
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 4b5de4f923f4d7871c059af54eb7d375f344f48a
      1702a53f
    • Yedidya Feldblum's avatar
      Use getCurrentThreadName() in EventBaseTestLib.h · 80031642
      Yedidya Feldblum authored
      Summary: [Folly] Use `getCurrentThreadName()` in `EventBaseTestLib.h` v.s. using pthread directly.
      
      Reviewed By: Orvid
      
      Differential Revision: D19226856
      
      fbshipit-source-id: 90f825ab0fc186a896cd63c425e55153daa0fefd
      80031642
    • Yedidya Feldblum's avatar
      Update a comment in CacheLocalityBenchmark.cpp · cc6aac41
      Yedidya Feldblum authored
      Summary: [Folly] Update a comment in `CacheLocalityBenchmark.cpp` to refer to the direct function used for fetching the thread-id.
      
      Reviewed By: Orvid
      
      Differential Revision: D19226855
      
      fbshipit-source-id: 8cf203daa7b3fbc00e387dca881be7f9ce47af95
      cc6aac41
    • Yedidya Feldblum's avatar
      Use std::thread in AtomicHashMapTest.cpp · d227b297
      Yedidya Feldblum authored
      Summary:
      [Folly] Use `std::thread` in `AtomicHashMapTest.cpp` instead of using the pthread API.
      
      In general in normal C++ code, prefer C++ standard library facilities over C facilities.
      
      Reviewed By: Orvid
      
      Differential Revision: D19226850
      
      fbshipit-source-id: 7edc5fca25266b48ab3e8c8829708594d7563409
      d227b297
    • Joe Loser's avatar
      Fix CMake build: EventBaseTestLib.cpp doesn't exist (#1284) · 77c8f6b0
      Joe Loser authored
      Summary:
      - EventBaseTestLib.cpp file was moved to EventBaseTestLibProvider.cpp
        in Differential Revision: D19001877.
      - Change CMakeLists.txt to specify EventBaseTestLibProvider.cpp so that
        CMake does not fail at configure time due to EventBaseTestLib.cpp not
        existing in the source tree.
      Pull Request resolved: https://github.com/facebook/folly/pull/1284
      
      Reviewed By: markisaa
      
      Differential Revision: D19226798
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 45a5e5ca03a52897a6f8f711761bf78ef386e6f6
      77c8f6b0
    • Yedidya Feldblum's avatar
      Fix typo in clang-format control · c3c26146
      Yedidya Feldblum authored
      Summary: [Folly] Fix typo in `clang-format` control.
      
      Reviewed By: markisaa
      
      Differential Revision: D19224383
      
      fbshipit-source-id: 1d153fb4eaead422d93c235e40163b8ae855d13a
      c3c26146
  10. 24 Dec, 2019 2 commits
  11. 21 Dec, 2019 7 commits
    • Yedidya Feldblum's avatar
      Let AtFork accept ptr-to-const handle · f519c88f
      Yedidya Feldblum authored
      Summary: [Folly] Let `AtFork` accept ptr-to-`const` handle rather than requiring only ptr-to-non-`const`.
      
      Reviewed By: luciang
      
      Differential Revision: D19208255
      
      fbshipit-source-id: c7a6ab42b7b652ebc4ea6465f80db37ef1d155df
      f519c88f
    • Yedidya Feldblum's avatar
      Rename object to handle in AtFork · 90222d1a
      Yedidya Feldblum authored
      Summary: [Folly] Rename `object` to `handle` in `AtFork` since it is used opaquely.
      
      Reviewed By: luciang
      
      Differential Revision: D19208246
      
      fbshipit-source-id: 3fc23e85b64f911f8e172a22f7e7080952d4dfe9
      90222d1a
    • Yedidya Feldblum's avatar
      Register with AtFork without an object in BufferedRandomDevice · 5edd05b5
      Yedidya Feldblum authored
      Summary: [Folly] Register with `AtFork` without an object in `BufferedRandomDevice`, since no object is actually needed and since it is possible for the object passed in to be destroyed.
      
      Reviewed By: luciang
      
      Differential Revision: D19207385
      
      fbshipit-source-id: 7c0e2793d9b438e576bf26bc3b3b459b372aec6d
      5edd05b5
    • Yedidya Feldblum's avatar
      Let AtFork ignore unregistration of nullptr objects · c8e0eca1
      Yedidya Feldblum authored
      Summary: [Folly] Let `AtFork` ignore unregistration of `nullptr` objects - i.e., let `nullptr` objects be the way of signaling immunity from unregistration.
      
      Reviewed By: luciang
      
      Differential Revision: D19207380
      
      fbshipit-source-id: 6dfee52bf815fc257697fb89d67f69cede0f39f6
      c8e0eca1
    • Yedidya Feldblum's avatar
      Define to_narrow in terms of implicit conversion · f3dfa82a
      Yedidya Feldblum authored
      Summary:
      [Folly] Define `to_narrow` in terms of implicit conversion to take advantage of ubsan's truncation checks.
      
      Note that integer truncation is not undefined behavior per se but is commonly unintended, so ubsan checks for it. Uses of `to_narrow` should not be subject to truncation; wherever truncation is anticipated, better to use an explicit conversion with a named destination type.
      
      Requires suppressing `-Wconversion` around the implicit conversion to avoid extraneous warnings and errors when the compiler detects narrowing implicit conversions. Since `to_narrow` models explicit conversion while merely being defined in terms of implicit conversion, it is already anticipated by all users that a narrowing conversion may occur; the warning is there to inform users only about unanticipated cases.
      
      Reviewed By: luciang
      
      Differential Revision: D19201430
      
      fbshipit-source-id: b3739d3d9aa05e95f7b3e4dff54e719691c1f04c
      f3dfa82a
    • Yedidya Feldblum's avatar
      Mark co_error as final · 186cd823
      Yedidya Feldblum authored
      Summary: [Folly] Mark `co_error` as `final`.
      
      Reviewed By: lewissbaker
      
      Differential Revision: D19173904
      
      fbshipit-source-id: 3dedf9a27629dd495d7097d00566a92753b65778
      186cd823
    • Yedidya Feldblum's avatar
      Forbid co_error with empty exception_wrapper · e23a4b1d
      Yedidya Feldblum authored
      Summary: [Folly] Forbid `co_error` with empty `exception_wrapper`.
      
      Reviewed By: lewissbaker
      
      Differential Revision: D19172250
      
      fbshipit-source-id: 5ffa7502eb97b6a084be3112b17f29bad2d96a0f
      e23a4b1d