1. 25 Feb, 2018 1 commit
  2. 24 Feb, 2018 4 commits
    • David Lai's avatar
      - Fix unused parameter warning in StlVectorTest.cpp · 974e6be0
      David Lai authored
      Summary: We are going to enable `-Werror=unused-parameter` flag and I need to manually fix some files so we rest of this process can be automated with a tool called clang-tidy.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D7071617
      
      fbshipit-source-id: 0165d9c79834b479ad0f598ea64404a86f47dcc6
      974e6be0
    • Yedidya Feldblum's avatar
      to_signed and to_unsigned · 5ec7c712
      Yedidya Feldblum authored
      Summary:
      [Folly] `to_signed` and `to_unsigned`, for casting a value to the signed or unsigned version of the value's type.
      
      And use them in time conversion functions.
      
      Reviewed By: markw65
      
      Differential Revision: D7020215
      
      fbshipit-source-id: 47a6aeeea487cd7d59d23e7ded40cc66dcc57c52
      5ec7c712
    • Yedidya Feldblum's avatar
      throw_exception to support -fno-exceptions · 1ea94b5e
      Yedidya Feldblum authored
      Summary:
      [Folly] `throw_exception` to support `-fno-exceptions`, switching all invocations of `std::__throw_....`.
      
      Removes the need to use the non-portable `bits/functexcept.h`.
      
      Reviewed By: mzlee, ot
      
      Differential Revision: D7050335
      
      fbshipit-source-id: 53d15639baa268a51f703816f04f314454d64979
      1ea94b5e
    • Joe Loser's avatar
      Simplify FsUtilTest.cpp · 740a9b01
      Joe Loser authored
      Summary:
      This test suite used to wrap equality of two paths by using `EXPECT_TRUE` to
      avoid an old bug in GTest 1.6.0. Now that we use GTest 1.8.0, we can
      simplify our test.
      Closes https://github.com/facebook/folly/pull/780
      
      Differential Revision: D7052503
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 5459736fca04cc45acf88a3d7dffc855ad7c9376
      740a9b01
  3. 23 Feb, 2018 6 commits
    • Xiao Shi's avatar
      EASY: clang-format fbvector benchmark · bc4bb891
      Xiao Shi authored
      Summary: format changes, purely generated by clang-format.
      
      Differential Revision: D7035579
      
      fbshipit-source-id: 8452e1613adefe7dcfbbed4a3ef97be681790416
      bc4bb891
    • Kyle Nekritz's avatar
      Fix alignment issues in small_vector. · b25dd31a
      Kyle Nekritz authored
      Summary: Packing the structs disregards the alignment of the storage. We should only do this on platforms where we do not need alignment.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D7058593
      
      fbshipit-source-id: 63b0d86bcf8b4f660ca244b1a4696e3ca64ecd6a
      b25dd31a
    • Kyle Nekritz's avatar
      Remove SmallLocks dependency from small_vector. · 478282cc
      Kyle Nekritz authored
      Reviewed By: yfeldblum
      
      Differential Revision: D7060959
      
      fbshipit-source-id: 914c517b4c8e93c15771f6acefaddce3138776a4
      478282cc
    • Joe Loser's avatar
      Add FindLZ4 module · 7dc5a4ed
      Joe Loser authored
      Summary:
      Add a CMake find_package script for LZ4
      
      simpkins
      Closes https://github.com/facebook/folly/pull/778
      
      Reviewed By: simpkins
      
      Differential Revision: D7064988
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 60596ead4b4fd38474dab4c33d4c3fbb0f37549c
      7dc5a4ed
    • Joe Loser's avatar
      Fix master branch broken for Clang · 8aa1a411
      Joe Loser authored
      Summary:
      Clang does not support the warning option "-Wclobbered", so we cannot
      do a pragma push and pop for this warning. So, we push and pop this
      particular warning for GCC only.
      
      As it stands currently, Clang accepts `#pragma GCC` directives. If this
      sort of thing comes up more in the future, it may make sense for Folly
      to define a macro for easily disabling warnings for either just GCC or
      just Clang.
      
      simpkins yfeldblum
      Closes https://github.com/facebook/folly/pull/779
      
      Reviewed By: simpkins
      
      Differential Revision: D7059916
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: a6d420dc6ae435e3be1229b2bb421910bc8794ff
      8aa1a411
    • Maged Michael's avatar
      hazptr: Clear hazard pointers in ~hazptr_array() and ~hazptr_local() · 13681962
      Maged Michael authored
      Summary:
      Clear hazard pointers in ~hazptr_array() and ~hazptr_local().
      Added tests to detect uncleared hazard pointers when using hazptr_array and hazptr_local.
      
      Differential Revision: D6995057
      
      fbshipit-source-id: 5b8fa1d197c3959ed670d0a019959bd57f5df3d0
      13681962
  4. 22 Feb, 2018 6 commits
    • Igor Sugak's avatar
      Back out "[codemod] - comment out unused parameters" · 49f93b0d
      Igor Sugak authored
      Reviewed By: igorsugak
      
      fbshipit-source-id: 4a93675cc1931089ddd574cacdb15d228b1e5f37
      49f93b0d
    • Krishna Monian's avatar
      Android doesn't have cache data in sysfs · a0a9d4d3
      Krishna Monian authored
      Summary: Since sysfs doesn't have cache information for the CPU on Android guard this on Android
      
      Reviewed By: yfeldblum
      
      Differential Revision: D7051199
      
      fbshipit-source-id: 20fcfa91aa2f642c6cab33b0fb55f121b609d58f
      a0a9d4d3
    • David Lai's avatar
      - comment out unused parameters · 53807d13
      David Lai authored
      Reviewed By: everiq, igorsugak
      
      Differential Revision: D7046710
      
      fbshipit-source-id: 8e10b1f1e2aecebbfb229c742e214db887e5a461
      53807d13
    • Alex Dibert's avatar
      Folly: AsyncSSLSocket good if uninit · 6fc754ff
      Alex Dibert authored
      Summary:
      This allows to create a Channel with AsyncSSLSocket while evb in not looping yet.
      Also add ssl channel tests to thrift.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6991017
      
      fbshipit-source-id: 0852b18e03a6b9d072cb4ec0182f1a41a5960eef
      6fc754ff
    • Yedidya Feldblum's avatar
      Fix folly/experimental/hazptr/ under gcc7 · e6b2e78a
      Yedidya Feldblum authored
      Summary:
      [Folly] Fix `folly/experimental/hazptr/` under gcc7, which has a bug in emitting TLS init functions for `extern thread_local` variables.
      
      Fixes:
      ```
      folly/experimental/hazptr/test/HazptrTest.cpp:642: error: undefined reference to 'TLS init function for folly::hazptr::tls_priv_data_'
      folly/experimental/hazptr/test/HazptrTest.cpp:642: error: undefined reference to 'TLS init function for folly::hazptr::tls_priv_data_'
      ```
      
      The trick is to use a template class with `static thread_local` members with member definitions in the same header, and then to use only one instance of that template class.
      
      Reviewed By: pixelb, magedm
      
      Differential Revision: D7047235
      
      fbshipit-source-id: 0551179a40f13796d6c0bb99aa806c73bd9dd471
      e6b2e78a
    • Andrey Malevich's avatar
      Back out "[folly] more ConcurrentHashMap deletion tests" · f6cbd144
      Andrey Malevich authored
      Summary:
      Original commit changeset: bee63b3f597d.
      
      Original revision is breaking integration tests by failing with the SIGSEGV in operator++, please check D6993857 for more details.
      
      Reviewed By: anshulverma
      
      Differential Revision: D7051998
      
      fbshipit-source-id: e5cfbb22aee5f5ec9871a9a34bb27eb5b0036d1b
      f6cbd144
  5. 21 Feb, 2018 6 commits
    • Dave Watson's avatar
      more ConcurrentHashMap deletion tests · 051bd89d
      Dave Watson authored
      Summary:
      Fixes for hazptr deletion on map destruction.
      
      Several iteration cases don't properly release their hazard pointers.
      This isn't disastrous, but means objects may stick around longer than necessary.
      
      This diff adds tests and fixes for iteration to ensure we eagerly reset all hazard pointers.
      
      Reviewed By: magedm
      
      Differential Revision: D6993857
      
      fbshipit-source-id: bee63b3f597d1ed16cae5ed22a971fd4be2e1a77
      051bd89d
    • Kenny Yu's avatar
      folly: extend gdb deadlock detector for pthread_rwlock_t · 1657dcf2
      Kenny Yu authored
      Summary:
      If a pthread_rwlock_t shared mutex is currently write-locked, we can
      find its owner. However, if it is not write-locked or read-locked
      (possibly by multiple threads), we will be unable to find the owner.
      
      We can extend our deadlock detector to find deadlocks involving write-locked
      pthread_rwlock_t mutexes as well.
      
      Example output:
      
        Type "deadlock" to detect deadlocks.
        (gdb) deadlock
        Found deadlock!
        Thread 2 (LWP ...) is waiting on pthread_mutex_t (0x...) held by Thread 3 (LWP ...)
        Thread 3 (LWP ...) is waiting on pthread_rwlock_t (0x...) held by Thread 2 (LWP ...)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6974509
      
      fbshipit-source-id: 8e64cb35f93958a9785070184df4c818b086ff0f
      1657dcf2
    • Adam Simpkins's avatar
      cmake: fix generation of folly-config.cmake · 2324cfbe
      Adam Simpkins authored
      Summary:
      The install step for folly CMake-based builds installs a folly-config.cmake
      file that downstream projects can use to depend on folly in their own
      CMakeLists.txt files.
      
      CMakeLists.txt was previously generating the folly-config.cmake file by copying
      CMake/folly-deps.cmake.  This seems wrong, as the installed folly-config.cmake
      file should not contain `find_package()` statements that depend on CMake
      modules only available in the folly source.
      
      This adds a new folly-config.cmake.in template instead.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D7035992
      
      fbshipit-source-id: e6023094a807cf481ac49998c6f21b213be6c288
      2324cfbe
    • Adam Simpkins's avatar
      subprocess: disable -Wclobbered around spawnInternal() · 9b7a5507
      Adam Simpkins authored
      Summary:
      When compiling with optimization enabled, gcc 7.2 complains about the
      `childDir` variable potentially being clobbered by the child process after
      `vfork()`.  This shouldn't matter since `childDir` is only used in the child
      process, and not in the parent after the `vfork()`.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D7035993
      
      fbshipit-source-id: c80a4e18ad4f629a3d08e310cfd4500ebaf70994
      9b7a5507
    • Adam Simpkins's avatar
      cmake: fix checks for compiler warning flags · 2adc542f
      Adam Simpkins authored
      Summary:
      gcc does not complain about unknown `-Wno-*` flags by default, and older
      versions of gcc do not support `-Werror=unknown-warning-option`.  Therefore
      these checks for `-Wno-noexcept-type` and `-Wno-nullability-completeness` could
      incorrectly indicate that the compiler supports these flags.
      
      This changes the checks to check against the positive version of the warning
      flag.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D7035995
      
      fbshipit-source-id: b1511d31721aeb779859848e20820c8a7fea4faa
      2adc542f
    • Joe Loser's avatar
      Closer to compiling with Clang · f58a4bd5
      Joe Loser authored
      Summary:
      This brings us closer to being able to compile the open
      source version of Folly with Clang. There are a few other
      open pull requests that need to be addressed to allow us to
      compile on Clang without any warnings that aren't already
      explicitly disabled. See pull requests #745 and #756.
      
      Closes https://github.com/facebook/folly/pull/772
      
      Reviewed By: simpkins
      
      Differential Revision: D7021595
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 350b972c74502ca2bc147f21428c622b19805b89
      f58a4bd5
  6. 20 Feb, 2018 6 commits
    • Yedidya Feldblum's avatar
      Avoid assuming that FOLLY_HAVE_VLA is defined · 7f258ae5
      Yedidya Feldblum authored
      Summary:
      [Folly] Avoid assuming that `FOLLY_HAVE_VLA` is defined.
      
      Treat undefined as meaning `0` rather than requiring it be defined to either `0` or `1`.
      
      Closes #773.
      
      Reviewed By: andrewjcg
      
      Differential Revision: D7028174
      
      fbshipit-source-id: 90c52a3c5b640776f728c70b69f0500749d7ab7f
      7f258ae5
    • Yedidya Feldblum's avatar
      Split definition of kMscVer from kIsWindows · 3af93759
      Yedidya Feldblum authored
      Summary: [Folly] Split definition of `kMscVer` from `kIsWindows` and use in `hazptr`.
      
      Reviewed By: mzlee
      
      Differential Revision: D7027159
      
      fbshipit-source-id: 1dd2bad821919a2d579aa615ecb2921e5a3ce4d8
      3af93759
    • Nick Terrell's avatar
      ConcurrentHashMap set size and max_size. · 66a6916f
      Nick Terrell authored
      Summary:
      During move construction and assignment `size_` and `max_size_` aren't set.
      Added a test case that attempted to allocate 4096 GB before the patch, and passes after.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D7005041
      
      fbshipit-source-id: b42a0a408ce49ddded4ba805fc064cd11df2457e
      66a6916f
    • Nick Terrell's avatar
      Log (de)compression bytes · 996729ec
      Nick Terrell authored
      Summary: Log bytes before/after (de)compression, and timing to the logging backend with probability 1/50.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6817204
      
      fbshipit-source-id: 7fde5284b8c97355ec445376a7c481e9ffd2cfce
      996729ec
    • Chad Austin's avatar
      Fix typo in SharedMutex documentation · 37b2d8bb
      Chad Austin authored
      Summary: s/lock_unshared/unlock_shared/
      
      Reviewed By: yfeldblum
      
      Differential Revision: D7017355
      
      fbshipit-source-id: 7f9d12b4c80cc796086a74890c58aceea931d93c
      37b2d8bb
    • Yedidya Feldblum's avatar
      Less goto in ltrimWhitespace and rtrimWhitespace · 1d687403
      Yedidya Feldblum authored
      Summary:
      [Folly] Less `goto` in `ltrimWhitespace` and `rtrimWhitespace`.
      
      The generated machine code remains unchanged for `g++ -O3` builds.
      
      Generally, prefer to use `goto` in cases which cannot, or which can only arduously, be accomplished without it. In other words, reserve `goto` to cases where `goto` is necessary, rather than to cases where it saves one line.
      
      Closes #732.
      
      Reviewed By: andrewjcg
      
      Differential Revision: D7027269
      
      fbshipit-source-id: 91a4c5dba0e4c13dc727393799edc9b596cdb8b9
      1d687403
  7. 18 Feb, 2018 1 commit
    • Andrew Krieger's avatar
      std::make_from_tuple is VS2017+ · 69aa532b
      Andrew Krieger authored
      Summary: It's not available in VS2015u3.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D7005874
      
      fbshipit-source-id: 5477018e444d9bf118089bbbcfabbbf4e16a3198
      69aa532b
  8. 17 Feb, 2018 1 commit
  9. 16 Feb, 2018 3 commits
    • Andrew Krieger's avatar
      Gate hazptr static_assert which is guaranteed to fail in MSVC · a47a5531
      Andrew Krieger authored
      Summary:
      std::atomic is no longer trivial, and VS2015 and VS2017 both
      fail this static assert, as will future versions of conforming compilers.
      Updates to folly mean that the hazptr header is transitively included in
      more places which makes it easier to trip this even when not using hazptr.
      Disabling this assert to visual studio at least saves users a headache.
      
      Reviewed By: yfeldblum, magedm
      
      Differential Revision: D7006587
      
      fbshipit-source-id: 8481e1d5668aee8cab703a04b2a390550c210a2c
      a47a5531
    • Nick Terrell's avatar
      Fix ConcurrentHashMap iterator copy · cf18a86f
      Nick Terrell authored
      Summary:
      UndefinedBehaviorSanitizer: null-pointer-use buck-out/dev-asan-ubsan/gen/folly/concurrency/concurrent_hash_map#header-mode-symlink-tree-with-header-map,headers/folly/concurrency/ConcurrentHashMap.h:440:30 in
      Finished test run: https://our.intern.facebook.com/intern/testinfra/testrun/882372015
      Summary (total time 1.49s):
        PASS: 0
        FAIL: 0
        SKIP: 0
        FATAL: 1
          folly/concurrency/test:concurrent_hash_map_test - ConcurrentHashMap.CopyIterator
        TIMEOUT: 0
        OMIT: 0
      ```
      
      Reviewed By: djwatson
      
      Differential Revision: D7003359
      
      fbshipit-source-id: d6764caf2dfb1f19cf5b38a9e89d7c0583c75412
      cf18a86f
    • Yedidya Feldblum's avatar
      Cut outdated comment referencing TFramedAsyncChannel · 83e410eb
      Yedidya Feldblum authored
      Summary: [Folly] Cut outdated comment referencing `TFramedAsyncChannel`.
      
      Reviewed By: knekritz
      
      Differential Revision: D7002980
      
      fbshipit-source-id: 206ac77abf8882e26a5b98ad4229c7a645912947
      83e410eb
  10. 15 Feb, 2018 2 commits
    • Andrii Grynenko's avatar
      addCallback API · 6dea6401
      Andrii Grynenko authored
      Summary: This makes it easier to integrate folly::Observer with callback-based code.
      
      Reviewed By: spalamarchuk
      
      Differential Revision: D6888234
      
      fbshipit-source-id: ccf9b57c07ee323ee11496d14f8c90e3331cc7bb
      6dea6401
    • Andrii Grynenko's avatar
      Make FiberManager.batonTimedWaitTimeout less flaky · 1172173d
      Andrii Grynenko authored
      Reviewed By: yfeldblum
      
      Differential Revision: D6957008
      
      fbshipit-source-id: 848932827efaf8529513026b45446da2c1697253
      1172173d
  11. 14 Feb, 2018 1 commit
    • Phil Willoughby's avatar
      relax requirements on join wrapper template · 7ee12309
      Phil Willoughby authored
      Summary: The template that this template wraps requires only forward iterators, so it doesn't make sense for the wrapper to be stricter than that.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D6988987
      
      fbshipit-source-id: 575dcacf7b1873ea0d7112acf84670842ee82fa7
      7ee12309
  12. 13 Feb, 2018 2 commits
    • Nick Gibson's avatar
      ConcurrentHashMap Deletion Test · ac3169a8
      Nick Gibson authored
      Summary: Add hazptr_cleanup to ConcurrentHashMap destructor & add a test to ensure deletion is working.
      
      Reviewed By: djwatson
      
      Differential Revision: D6951359
      
      fbshipit-source-id: 277c304a0e5073605010b14764d05a27e6e10b2d
      ac3169a8
    • Maged Michael's avatar
      hazptr: Fix hazptr_cleanup · 8635022f
      Maged Michael authored
      Summary:
      Added missing steps for registering and deregistering per-thread hazptr_priv structures with the default domain.
      Updated tests to detect the error
      
      Reviewed By: djwatson, davidtgoldblatt
      
      Differential Revision: D6965459
      
      fbshipit-source-id: 6eb6a5981c1d22518f318ace7387a3941a013352
      8635022f
  13. 12 Feb, 2018 1 commit
    • Igor Sugak's avatar
      enable FOLLY_DISABLE_UNDEFINED_BEHAVIOR_SANITIZER macro in ASAN · a12a2a09
      Igor Sugak authored
      Summary:
      It's common to use UBSAN with ASAN at the same time, and we'll merge them eventually too. As a result we can check for ASAN defined macros to conditionally compile code for UBSAN.
      
      We still have a few build modes that use standalone UBSAN, and unlike other sanitizers, UBSAN doesn't define a magic macro that we could use. In the past we added UNDEFINED_SANITIZER to our compiler flags, but I'd like to go away from it towards a more standard solution (eg check for ASAN).
      
      Reviewed By: yfeldblum, luciang
      
      Differential Revision: D6931054
      
      fbshipit-source-id: 4b298d1cd72cecd693bf99eda309568ef019c544
      a12a2a09